[Fb-contrib-commit] SF.net SVN: fb-contrib: [718] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-12-10 09:14:44
|
Revision: 718 http://svn.sourceforge.net/fb-contrib/?rev=718&view=rev Author: dbrosius Date: 2006-12-10 01:14:38 -0800 (Sun, 10 Dec 2006) Log Message: ----------- don't create a scope block on a GOTO at the end of an if block (before an else) Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2006-12-10 07:16:06 UTC (rev 717) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedAssignmentScope.java 2006-12-10 09:14:38 UTC (rev 718) @@ -149,11 +149,8 @@ if (target > getPC()) { if ((seen == GOTO) || (seen == GOTO_W)) { ScopeBlock sb = findScopeBlockWithTarget(rootScopeBlock, getPC(), getNextPC()); - if (sb != null) { + if (sb == null) { sb = new ScopeBlock(getPC(), target); - rootScopeBlock.addChild(sb); - } else { - sb = new ScopeBlock(getPC(), target); sb.setLoop(); rootScopeBlock.addChild(sb); } @@ -207,7 +204,7 @@ * @return the scope block found or null */ private ScopeBlock findScopeBlockWithTarget(ScopeBlock sb, int start, int target) { - if ((sb.startLocation < start) && (sb.finishLocation <= target)) + if ((sb.startLocation < start) && (sb.finishLocation >= start) && (sb.finishLocation <= target)) return sb; if (sb.children != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |