[Scummvm-cvs-logs] SF.net SVN: scummvm:[51123] tools/branches/gsoc2010-decompiler/decompiler/ codegen.cpp

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Thu Jul 22 01:22:54 CEST 2010


Revision: 51123
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51123&view=rev
Author:   pidgeot
Date:     2010-07-21 23:22:54 +0000 (Wed, 21 Jul 2010)

Log Message:
-----------
Move binary operator handling to generic class

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp

Modified: tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp	2010-07-21 23:11:30 UTC (rev 51122)
+++ tools/branches/gsoc2010-decompiler/decompiler/codegen.cpp	2010-07-21 23:22:54 UTC (rev 51123)
@@ -143,7 +143,7 @@
 
 	ConstInstIterator it = _curGroup->_start;
 	do {
-		if (it->_codeGenData.find("\xC0" == 0))
+		if (it->_codeGenData.length() > 0 && it->_codeGenData.find("\xC0") == 0)
 			processInst(*it);
 		else {
 			switch (it->_type) {
@@ -158,6 +158,14 @@
 					_stack.push(p);
 					break;
 				}
+			case kBinaryOp:
+			case kComparison:
+			{
+				EntryPtr rhs = _stack.pop();
+				EntryPtr lhs = _stack.pop();
+				_stack.push(new BinaryOpEntry(lhs, rhs, it->_codeGenData));
+				break;
+			}
 			case kCondJump:
 			case kCondJumpRel:
 				{
@@ -180,8 +188,9 @@
 					addOutputLine(s.str());
 				}
 				break;
-				default:
-					processInst(*it);
+			default:
+				processInst(*it);
+				break;
 			}
 		}
 	} while (it++ != _curGroup->_end);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list