Another fix: The fall through for opc_dadd and co. didn't work

Fixed the order of pops for invoke*


git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1283 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
hoenicke 24 years ago
parent 7eb1d3f8b5
commit fb5d918702
  1. 19
      jode/jode/obfuscator/modules/ConstantAnalyzer.java.in

@ -1531,7 +1531,8 @@ public class ConstantAnalyzer implements Opcodes, CodeAnalyzer {
case opc_lrem: case opc_drem:
case opc_land: case opc_lor : case opc_lxor:
iter.set(new Instruction(opc_pop2));
/* fall through */
iter.add(new Instruction(opc_pop2));
break;
case opc_if_icmpeq: case opc_if_icmpne:
case opc_if_icmplt: case opc_if_icmpge:
case opc_if_icmpgt: case opc_if_icmple:
@ -1574,14 +1575,14 @@ public class ConstantAnalyzer implements Opcodes, CodeAnalyzer {
case opc_invokevirtual: {
Reference ref = instr.getReference();
String[] pt = TypeSignature.getParameterTypes(ref.getType());
int arg = 0;
if (instr.getOpcode() != opc_invokestatic)
iter.set(new Instruction(opc_pop));
else if (pt.length > 0) {
iter.set(new Instruction(TypeSignature.getTypeSize(pt[0])
int len = pt.length;
if (len > 0)
iter.set(new Instruction(TypeSignature.getTypeSize(pt[--len])
+ opc_pop - 1));
arg++;
} else {
else if (instr.getOpcode() != opc_invokestatic)
iter.set(new Instruction(opc_pop));
else {
if (replacement == null)
iter.remove();
else
@ -1589,7 +1590,7 @@ public class ConstantAnalyzer implements Opcodes, CodeAnalyzer {
return;
}
for (int i=arg; i < pt.length; i++)
for (int i = len - 1; i >= 0; i++)
iter.add(new Instruction(TypeSignature.getTypeSize(pt[i])
+ opc_pop - 1));
}

Loading…
Cancel
Save