[Fb-contrib-commit] fb-contrib/src/com/mebigfatguy/fbcontrib/detect ArrayWrappedCallByReference.java
Brought to you by:
dbrosius
|
From: Dave B. <dbr...@us...> - 2006-01-24 07:18:25
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17857/src/com/mebigfatguy/fbcontrib/detect Modified Files: ArrayWrappedCallByReference.java Log Message: guard against arrayindexoutofbounds excpetions Index: ArrayWrappedCallByReference.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ArrayWrappedCallByReference.java 23 Jan 2006 07:53:06 -0000 1.1 +++ ArrayWrappedCallByReference.java 24 Jan 2006 07:18:17 -0000 1.2 @@ -121,7 +121,8 @@ } else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) { if (stack.getStackDepth() >= 1) { OpcodeStack.Item itm = stack.getStackItem(0); - if (itm.getSignature().charAt(0) == '[') { + String sig = itm.getSignature(); + if ((sig.length() > 0) && (itm.getSignature().charAt(0) == '[')) { int reg = getAStoreReg(seen); Integer elReg = (Integer)itm.getUserValue(); if (elReg != null) @@ -148,7 +149,8 @@ if (stack.getStackDepth() >= args.length) { for (int i = 0; i < args.length; i++) { Type t = args[i]; - if (t.getSignature().charAt(0) == '[') { + String argSig = t.getSignature(); + if ((argSig.length() > 0) && (argSig.charAt(0) == '[')) { OpcodeStack.Item itm = stack.getStackItem(args.length - i - 1); int arrayReg = itm.getRegisterNumber(); WrapperInfo wi = wrappers.get(new Integer(arrayReg)); |