[Fb-contrib-commit] SF.net SVN: fb-contrib:[1260] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2009-09-06 20:06:35
|
Revision: 1260 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1260&view=rev Author: dbrosius Date: 2009-09-06 20:06:15 +0000 (Sun, 06 Sep 2009) Log Message: ----------- knock down some fps Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-06 19:38:27 UTC (rev 1259) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-06 20:06:15 UTC (rev 1260) @@ -161,7 +161,14 @@ case BASTORE: case CASTORE: case SASTORE: { - + if (stack.getStackDepth() >= 3) { + OpcodeStack.Item item = stack.getStackItem(2); + item.setUserValue(null); + int reg = item.getRegisterNumber(); + if (reg >= 0) { + uninitializedRegs.clear(reg); + } + } } break; @@ -171,7 +178,12 @@ case ASTORE_2: case ASTORE_3: { int reg = RegisterUtils.getAStoreReg(this, seen); - uninitializedRegs.set(reg); + if (stack.getStackDepth() > 0) { + OpcodeStack.Item item = stack.getStackItem(0); + uninitializedRegs.set(reg, (UNINIT_ARRAY.equals(item.getUserValue()))); + } else { + uninitializedRegs.clear(reg); + } } break; @@ -206,7 +218,7 @@ } } finally { stack.sawOpcode(this, seen); - if (userValue != null) { + if (UNINIT_ARRAY.equals(userValue)) { if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); item.setUserValue(UNINIT_ARRAY); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |