[Fb-contrib-commit] fb-contrib/src/com/mebigfatguy/fbcontrib/detect ArrayWrappedCallByReference.java
Brought to you by:
dbrosius
|
From: Dave B. <dbr...@us...> - 2006-01-25 03:26:27
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30070/src/com/mebigfatguy/fbcontrib/detect Modified Files: ArrayWrappedCallByReference.java Log Message: make sure the wrapper is passed as an arg to a method Index: ArrayWrappedCallByReference.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ArrayWrappedCallByReference.java 24 Jan 2006 07:18:17 -0000 1.2 +++ ArrayWrappedCallByReference.java 25 Jan 2006 03:26:18 -0000 1.3 @@ -38,15 +38,12 @@ public class ArrayWrappedCallByReference extends BytecodeScanningDetector implements StatelessDetector { static class WrapperInfo { - static final int WAS_STORED = 0; - static final int WAS_ARG = 1; - static final int WAS_LOADED = 2; public int wrappedReg; - public int state; + public boolean wasArg; public WrapperInfo(int reg) { wrappedReg = reg; - state = WAS_STORED; + wasArg = false; } } @@ -155,7 +152,7 @@ int arrayReg = itm.getRegisterNumber(); WrapperInfo wi = wrappers.get(new Integer(arrayReg)); if (wi != null) - wi.state = WrapperInfo.WAS_ARG; + wi.wasArg = true; } } } @@ -164,7 +161,7 @@ OpcodeStack.Item arItm = stack.getStackItem(1); int arReg = arItm.getRegisterNumber(); WrapperInfo wi = wrappers.get(new Integer(arReg)); - if (wi != null) { + if ((wi != null) && wi.wasArg) { userValue = wi.wrappedReg; } } |