[Fb-contrib-commit] SF.net SVN: fb-contrib: [987] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-01-18 17:12:30
|
Revision: 987 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=987&view=rev Author: dbrosius Date: 2008-01-18 09:09:52 -0800 (Fri, 18 Jan 2008) Log Message: ----------- guard against OpcodeStack having problems Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java 2008-01-17 22:48:05 UTC (rev 986) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java 2008-01-18 17:09:52 UTC (rev 987) @@ -139,12 +139,14 @@ Integer reg = Integer14.valueOf(RegisterUtils.getALoadReg(this, seen)); sawEnumCollectionCreation = enumRegs.get(reg); } else if (seen == PUTFIELD) { - String fieldName = getNameConstantOperand(); - OpcodeStack.Item itm = stack.getStackItem(0); - if (itm.getUserValue() != null) - enumFields.put(fieldName, (Boolean)itm.getUserValue()); - else - enumFields.remove(fieldName); + if (stack.getStackDepth() > 0) { + String fieldName = getNameConstantOperand(); + OpcodeStack.Item itm = stack.getStackItem(0); + if (itm.getUserValue() != null) + enumFields.put(fieldName, (Boolean)itm.getUserValue()); + else + enumFields.remove(fieldName); + } } else if (seen == GETFIELD) { String fieldName = getNameConstantOperand(); sawEnumCollectionCreation = enumFields.get(fieldName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |