Issue #1008 pushshort instruction diassembly fix

This commit is contained in:
Jindra Petřík
2015-10-29 22:12:39 +01:00
parent 48f1962476
commit d16a3a266c
4 changed files with 11 additions and 1 deletions

View File

@@ -332,6 +332,8 @@ public class AVM2Code implements Cloneable {
public static final int OPT_BYTE = 0x500;
public static final int OPT_U30_SHORT = 0x600;
public static final int DAT_MULTINAME_INDEX = OPT_U30 + 0x01;
public static final int DAT_ARG_COUNT = OPT_U30 + 0x02;
@@ -876,6 +878,9 @@ public class AVM2Code implements Cloneable {
case OPT_U30:
actualOperands[op] = ais.readU30("operand");
break;
case OPT_U30_SHORT:
actualOperands[op] = (short) ais.readU30("operand");
break;
case OPT_U8:
actualOperands[op] = ais.read("operand");
break;

View File

@@ -88,6 +88,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
aos.writeS24(operands[i]);
break;
case AVM2Code.OPT_U30:
case AVM2Code.OPT_U30_SHORT:
aos.writeU30(operands[i]);
break;
case AVM2Code.OPT_U8:
@@ -120,6 +121,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
cnt += 3;
break;
case AVM2Code.OPT_U30:
case AVM2Code.OPT_U30_SHORT:
cnt += ABCOutputStream.getU30ByteLength(operands[i]);
break;
case AVM2Code.OPT_U8:

View File

@@ -68,6 +68,9 @@ public abstract class InstructionDefinition implements Serializable {
if ((operands[i] & 0xff00) == AVM2Code.OPT_U30) {
s.append(" U30");
}
if ((operands[i] & 0xff00) == AVM2Code.OPT_U30_SHORT) {
s.append(" U30");
}
if ((operands[i] & 0xff00) == AVM2Code.OPT_U8) {
s.append(" U8");
}

View File

@@ -31,7 +31,7 @@ import java.util.List;
public class PushShortIns extends InstructionDefinition implements PushIntegerTypeIns {
public PushShortIns() {
super(0x25, "pushshort", new int[]{AVM2Code.OPT_U30}, false);
super(0x25, "pushshort", new int[]{AVM2Code.OPT_U30_SHORT}, false);
}
@Override