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

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Sun Jul 4 23:58:43 CEST 2010


Revision: 50655
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50655&view=rev
Author:   pidgeot
Date:     2010-07-04 21:58:42 +0000 (Sun, 04 Jul 2010)

Log Message:
-----------
Fix bug in continue detection

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

Modified: tools/branches/gsoc2010-decompiler/decompiler/control_flow.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/control_flow.cpp	2010-07-04 21:31:09 UTC (rev 50654)
+++ tools/branches/gsoc2010-decompiler/decompiler/control_flow.cpp	2010-07-04 21:58:42 UTC (rev 50655)
@@ -332,13 +332,14 @@
 			Group *targetGr = GET(target);
 			// ...to a while or do-while condition...
 			if (targetGr->_type == kWhileCond || targetGr->_type == kDoWhileCond) {
+				bool isContinue = true;
 				// ...unless it is targeting a while condition...
 				if (targetGr->_type == kWhileCond) {
 					OutEdgeRange toer = boost::out_edges(target, _g);
 					for (OutEdgeIterator toe = toer.first; toe != toer.second; ++toe) {
-						// which jumps to the next sequential group
-						if (GET(boost::target(*toe, _g)) == targetGr->_next)
-							continue;
+						// ...which jumps to the next sequential group
+						if (GET(boost::target(*toe, _g)) == gr->_next)
+							isContinue = false;
 					}
 				}
 				Group *from, *to, *cursor;
@@ -352,7 +353,6 @@
 				}
 
 				GroupType ogt = (targetGr->_type == kDoWhileCond ? kWhileCond : kDoWhileCond);
-				bool isContinue = true;
 				// Verify that destination deals with innermost while/do-while
 				for (cursor = from; cursor->_next != NULL && cursor != to; cursor = cursor->_next) {
 					if (cursor->_type == targetGr->_type) {


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