[Fb-contrib-commit] SF.net SVN: fb-contrib: [939] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2007-10-18 03:44:58
|
Revision: 939 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=939&view=rev Author: dbrosius Date: 2007-10-17 20:44:58 -0700 (Wed, 17 Oct 2007) Log Message: ----------- try to salvage SPP_USELESS_TRINARY Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2007-10-13 06:06:58 UTC (rev 938) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2007-10-18 03:44:58 UTC (rev 939) @@ -111,25 +111,28 @@ } - if (seen == ICONST_0) { + if (seen == IRETURN) { byte[] bytes = getCode().getCode(); if ((lastPCs[3] != -1) - && ((0x00FF & bytes[lastPCs[3]]) == GOTO) - && ((0x00FF & bytes[lastPCs[2]]) == ICONST_1) - && ((0x00FF & bytes[lastPCs[1]]) == IFEQ)) { - boolean bug = true; - Set<Integer> branchInsSet = branchTargets.get(Integer.valueOf(getPC())); - if (branchInsSet.size() > 1) - bug = false; - branchInsSet = branchTargets.get(Integer.valueOf(lastPCs[2])); - if (branchInsSet != null) - bug = false; - - if (bug) { - bugReporter.reportBug(new BugInstance(this, "SPP_USELESS_TRINARY", NORMAL_PRIORITY) - .addClass(this) - .addMethod(this) - .addSourceLine(this)); + && ((0x00FF & bytes[lastPCs[3]]) == ICONST_0) + && ((0x00FF & bytes[lastPCs[2]]) == GOTO) + && ((0x00FF & bytes[lastPCs[1]]) == ICONST_1) + && ((0x00FF & bytes[lastPCs[0]]) == IFEQ)) { + if (getMethod().getSignature().endsWith("Z")) { + boolean bug = true; + Set<Integer> branchInsSet = branchTargets.get(Integer.valueOf(lastPCs[1])); + if (branchInsSet != null) + bug = false; + branchInsSet = branchTargets.get(Integer.valueOf(lastPCs[3])); + if ((branchInsSet != null) && branchInsSet.size() > 1) + bug = false; + + if (bug) { + bugReporter.reportBug(new BugInstance(this, "SPP_USELESS_TRINARY", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } } } } else if (seen == LDC2_W) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |