[Fb-contrib-commit] SF.net SVN: fb-contrib: [739] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-12-19 08:16:34
|
Revision: 739 http://svn.sourceforge.net/fb-contrib/?rev=739&view=rev Author: dbrosius Date: 2006-12-19 00:16:30 -0800 (Tue, 19 Dec 2006) Log Message: ----------- starting to work Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2006-12-19 07:41:37 UTC (rev 738) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2006-12-19 08:16:30 UTC (rev 739) @@ -138,8 +138,8 @@ groupId = findCollectionGroup(itm, true); } } else if ("remove(Ljava/lang/Object;)Z".equals(methodInfo)) { - if (stack.getStackDepth() > 0) { - OpcodeStack.Item itm = stack.getStackItem(0); + if (stack.getStackDepth() > 1) { + OpcodeStack.Item itm = stack.getStackItem(1); int id = findCollectionGroup(itm, true); if (id >= 0) { Integer it = groupToIterator.get(id); @@ -196,8 +196,13 @@ if (id != null) { int target = getBranchTarget(); int gotoAddr = target - 3; - if (getCode().getCode()[gotoAddr] == GOTO) { - loops.put(id, new Loop(getPC(), gotoAddr)); + int ins = getCode().getCode()[gotoAddr]; + if (ins < 0) + ins = 256 + ins; + if (ins == GOTO) { + Integer reg = groupToIterator.get(id); + if (reg != null) + loops.put(reg, new Loop(getPC(), gotoAddr)); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |