[Fb-contrib-commit] SF.net SVN: fb-contrib: [622] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/de
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-08-21 02:47:30
|
Revision: 622 Author: dbrosius Date: 2006-08-20 19:47:24 -0700 (Sun, 20 Aug 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=622&view=rev Log Message: ----------- Remove some false positives due to a DOM node being loaded, and method called on it, leaving an entry in the nodeCreations map. Now remove entries when a method is called on it, as the DOM api, never leaves this on the stack. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java 2006-08-20 00:41:27 UTC (rev 621) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java 2006-08-21 02:47:24 UTC (rev 622) @@ -27,6 +27,7 @@ import org.apache.bcel.generic.Type; import com.mebigfatguy.fbcontrib.utils.Integer14; +import com.mebigfatguy.fbcontrib.utils.RegisterUtils; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; @@ -141,11 +142,7 @@ } } else if ((seen == ASTORE) || ((seen >= ASTORE_0) && seen <= ASTORE_3)) { Integer pc = findDOMNodeCreationPoint(0); - int reg; - if (seen == ASTORE) - reg = getRegisterOperand(); - else - reg = seen - ASTORE_0; + int reg = RegisterUtils.getAStoreReg(this, seen); if (pc != null) nodeStores.put(Integer14.valueOf(reg), pc); else @@ -154,11 +151,7 @@ //Stores to member variables are assumed ok findDOMNodeCreationPoint(0); } else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) { - int reg; - if (seen == ALOAD) - reg = getRegisterOperand(); - else - reg = seen - ALOAD_0; + int reg = RegisterUtils.getALoadReg(this, seen); itemPC = nodeStores.get(Integer14.valueOf(reg)); if (itemPC != null) sawCreate = true; @@ -187,6 +180,9 @@ nodeStores.remove(Integer14.valueOf(reg)); } } + if ((seen != INVOKESTATIC) && (stack.getStackDepth() > argCount)) { + nodeCreations.remove(stack.getStackItem(argCount)); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |