+ Constants.OPCODE_NAMES[jcfaCode.getOpcode()]);
short operands = Constants.NO_OF_OPERANDS[jcfaCode.getOpcode()];
- if (operands < 0) {
- jcfaCode.getComment()
- .getCommentList()
- .add("FIXME NO_OF_OPERANDS has negative value:"
- + Constants.OPCODE_NAMES[jcfaCode.getOpcode()]
- + ": " + operands);
- return operands;
- }
+ if (operands == Constants.UNPREDICTABLE) {
+ switch (jcfaCode.getOpcode()) {
+ case Constants.TABLESWITCH: {
+ jcfaCode.getComment().getCommentList()
+ .add(" TODO no support opecode and operands");
+ return Constants.UNPREDICTABLE;
+ }
+ case Constants.LOOKUPSWITCH: {
+ int result = JcfaUtil.byte2Int(codes[pc + 1], codes[pc + 2],
+ codes[pc + 3], codes[pc + 4]);
- switch (jcfaCode.getOpcode()) {
- case Constants.RETURN:
- break;
- case Constants.GETSTATIC:
- break;
- case Constants.LDC:
- break;
- case Constants.INVOKEVIRTUAL:
- case Constants.INVOKESPECIAL:
- break;
- case Constants.LOOKUPSWITCH: {
- int result = JcfaUtil.byte2Int(codes[pc + 1], codes[pc + 2],
- codes[pc + 3], codes[pc + 4]);
- System.out.println(" TODO skipping bytes: " + (result));
-
- int lookupOp = pc + 5;
-
- short diff = JcfaUtil.byte2UnsignedByte(codes[lookupOp++]);
- System.out.println(" TODO skipping bytes: " + (diff));
-
- int loopCount = JcfaUtil.byte2Int(codes[lookupOp++],
- codes[lookupOp++], codes[lookupOp++], codes[lookupOp++]);
-
- short diff2 = JcfaUtil.byte2UnsignedByte(codes[lookupOp++]);
- jcfaCode.getComment().getCommentList()
- .add(" TODO skipping bytes: " + (diff2));
-
- operands += (lookupOp - pc);
- }
- break;
- default:
- break;
+ int lookupOp = pc + 5;
+
+ short diff = JcfaUtil.byte2UnsignedByte(codes[lookupOp++]);
+
+ int loopCount = JcfaUtil
+ .byte2Int(codes[lookupOp++], codes[lookupOp++],
+ codes[lookupOp++], codes[lookupOp++]);
+
+ short diff2 = JcfaUtil.byte2UnsignedByte(codes[lookupOp++]);
+ jcfaCode.getComment().getCommentList()
+ .add(" TODO skipping bytes: " + (diff2));
+
+ operands += (lookupOp - pc);
+ break;
+ }
+ case Constants.WIDE: {
+ jcfaCode.getComment().getCommentList()
+ .add(" TODO no support opecode and operands");
+ return Constants.UNPREDICTABLE;
+ }
+ }
}
{