Merge origin/master

This commit is contained in:
Jindra Petřík
2015-11-18 19:25:58 +01:00
99 changed files with 970 additions and 586 deletions

View File

@@ -656,16 +656,16 @@ public class AVM2Code implements Cloneable {
}
public Object execute(HashMap<Integer, Object> arguments, AVM2ConstantPool constants) throws AVM2ExecutionException {
return execute(arguments, constants, AVM2Runtime.UNKNOWN, 0);
return execute(arguments, constants, null);
}
public Object execute(HashMap<Integer, Object> arguments, AVM2ConstantPool constants, AVM2Runtime runtime, int runtimeVersoin) throws AVM2ExecutionException {
public Object execute(HashMap<Integer, Object> arguments, AVM2ConstantPool constants, AVM2RuntimeInfo runtimeInfo) throws AVM2ExecutionException {
int pos = 0;
LocalDataArea lda = new LocalDataArea();
lda.methodName = "methodName"; // todo: needed for VerifyError exception message
lda.localRegisters = arguments;
lda.runtime = runtime;
lda.runtimeVersion = runtimeVersoin;
lda.runtimeInfo = runtimeInfo;
for (AVM2Instruction ins : code) {
ins.definition.verify(lda, constants, ins);
}
@@ -680,7 +680,7 @@ public class AVM2Code implements Cloneable {
try {
pos = adr2pos(lda.jump);
} catch (ConvertException ex) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.BRANCH_TARGET_INVALID_INSTRUCTION);
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.BRANCH_TARGET_INVALID_INSTRUCTION, lda.isDebug());
}
lda.jump = null;
} else {

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. */
package com.jpexs.decompiler.flash.abc.avm2;
/**
*
* @author JPEXS
*/
public class AVM2RuntimeInfo {
public AVM2Runtime runtime;
public int version;
public boolean debug;
public AVM2RuntimeInfo(AVM2Runtime runtime, int version, boolean debug) {
this.runtime = runtime;
this.version = version;
this.debug = debug;
}
}

View File

@@ -35,9 +35,7 @@ public class LocalDataArea {
public String executionException;
public AVM2Runtime runtime;
public int runtimeVersion;
public AVM2RuntimeInfo runtimeInfo;
private byte[] domainMemory;
@@ -46,12 +44,20 @@ public class LocalDataArea {
public byte[] getDomainMemory() {
if (domainMemory == null) {
domainMemory = new byte[1024 * 1024];
domainMemory = new byte[1024]; // in flash player this is the default size
}
return domainMemory;
}
public AVM2Runtime getRuntime() {
return runtimeInfo == null ? AVM2Runtime.UNKNOWN : runtimeInfo.runtime;
}
public boolean isDebug() {
return runtimeInfo != null && runtimeInfo.debug;
}
public void clear() {
operandStack.clear();
scopeStack.clear();

View File

@@ -21,23 +21,23 @@ package com.jpexs.decompiler.flash.abc.avm2.exceptions;
*/
public class AVM2RangeErrorException extends AVM2ExecutionException {
public AVM2RangeErrorException(int code) {
super(codeToMessage(code, null));
public AVM2RangeErrorException(int code, boolean debug) {
super(codeToMessage(code, debug, null));
}
public AVM2RangeErrorException(int code, Object[] params) {
super(codeToMessage(code, params));
public AVM2RangeErrorException(int code, boolean debug, Object[] params) {
super(codeToMessage(code, debug, params));
}
private static String codeToMessage(int code, Object[] params) {
private static String codeToMessage(int code, boolean debug, Object[] params) {
String msg = null;
switch (code) {
}
String result = "RangeError: Error #" + code;
/*if (msg != null) {
result += ": " + msg;
}*/
if (debug && msg != null) {
result += ": " + msg;
}
return result;
}

View File

@@ -21,23 +21,23 @@ package com.jpexs.decompiler.flash.abc.avm2.exceptions;
*/
public class AVM2TypeErrorException extends AVM2ExecutionException {
public AVM2TypeErrorException(int code) {
super(codeToMessage(code, null));
public AVM2TypeErrorException(int code, boolean debug) {
super(codeToMessage(code, debug, null));
}
public AVM2TypeErrorException(int code, Object[] params) {
super(codeToMessage(code, params));
public AVM2TypeErrorException(int code, boolean debug, Object[] params) {
super(codeToMessage(code, debug, params));
}
private static String codeToMessage(int code, Object[] params) {
private static String codeToMessage(int code, boolean debug, Object[] params) {
String msg = null;
switch (code) {
}
String result = "TypeError: Error #" + code;
/*if (msg != null) {
result += ": " + msg;
}*/
if (debug && msg != null) {
result += ": " + msg;
}
return result;
}

View File

@@ -27,15 +27,15 @@ public class AVM2VerifyErrorException extends AVM2ExecutionException {
public static final int CPOOL_INDEX_OUT_OF_RANGE = 1032;
public AVM2VerifyErrorException(int code) {
super(codeToMessage(code, null));
public AVM2VerifyErrorException(int code, boolean debug) {
super(codeToMessage(code, debug, null));
}
public AVM2VerifyErrorException(int code, Object[] params) {
super(codeToMessage(code, params));
public AVM2VerifyErrorException(int code, boolean debug, Object[] params) {
super(codeToMessage(code, debug, params));
}
private static String codeToMessage(int code, Object[] params) {
private static String codeToMessage(int code, boolean debug, Object[] params) {
String msg = null;
switch (code) {
case ILLEGAL_OPCODE:
@@ -56,9 +56,9 @@ public class AVM2VerifyErrorException extends AVM2ExecutionException {
}
String result = "VerifyError: Error #" + code;
/*if (msg != null) {
result += ": " + msg;
}*/
if (debug && msg != null) {
result += ": " + msg;
}
return result;
}

View File

@@ -98,27 +98,27 @@ public abstract class InstructionDefinition implements Serializable {
if (operand == AVM2Code.DAT_MULTINAME_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getMultinameCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getMultinameCount()});
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getMultinameCount()});
}
} else if (operand == AVM2Code.DAT_DOUBLE_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getDoubleCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getDoubleCount()});
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getDoubleCount()});
}
} else if (operand == AVM2Code.DAT_INT_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getIntCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getIntCount()});
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getIntCount()});
}
} else if (operand == AVM2Code.DAT_UINT_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getUIntCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getUIntCount()});
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getUIntCount()});
}
} else if (operand == AVM2Code.DAT_STRING_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getStringCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getStringCount()});
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getStringCount()});
}
}
}
@@ -130,7 +130,7 @@ public abstract class InstructionDefinition implements Serializable {
}
protected void illegalOpCode(LocalDataArea lda, AVM2Instruction ins) throws AVM2VerifyErrorException {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.ILLEGAL_OPCODE, new Object[]{lda.methodName, instructionCode, ins.getOffset()});
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.ILLEGAL_OPCODE, lda.isDebug(), new Object[]{lda.methodName, instructionCode, ins.getOffset()});
}
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) throws InterruptedException {

View File

@@ -17,8 +17,9 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
/**
*
@@ -31,8 +32,12 @@ public class UnknownInstruction extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
illegalOpCode(lda, ins);
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
return false;
}
}

View File

@@ -41,10 +41,10 @@ public class Lf32Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
// todo: get 32 bits float

View File

@@ -41,10 +41,10 @@ public class Lf64Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
// todo: get 64 bits float

View File

@@ -41,10 +41,10 @@ public class Li16Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
// todo: get 16 bits

View File

@@ -41,10 +41,10 @@ public class Li32Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
// todo: get 32 bits

View File

@@ -41,10 +41,10 @@ public class Li8Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
lda.operandStack.push((Double) (double) (domainMemory[addr]));

View File

@@ -41,10 +41,10 @@ public class Sf32Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
Double value = (double) EcmaScript.toNumber(lda.operandStack.pop());

View File

@@ -41,10 +41,10 @@ public class Sf64Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
Double value = (double) EcmaScript.toNumber(lda.operandStack.pop());

View File

@@ -41,10 +41,10 @@ public class Si16Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
int value = EcmaScript.toInt32(lda.operandStack.pop());

View File

@@ -41,10 +41,10 @@ public class Si32Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
int value = EcmaScript.toInt32(lda.operandStack.pop());

View File

@@ -41,10 +41,10 @@ public class Si8Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
int addr = EcmaScript.toInt32(lda.operandStack.pop());
byte[] domainMemory = lda.getDomainMemory();
if (addr < 0 || addr >= domainMemory.length) {
throw new AVM2RangeErrorException(1506);
throw new AVM2RangeErrorException(1506, lda.isDebug());
}
int value = EcmaScript.toInt32(lda.operandStack.pop());

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class AbsJumpIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class AddDIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,11 +31,11 @@ public class AddPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class AllocIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,11 +31,11 @@ public class CallInterfaceIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -17,9 +17,9 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -30,11 +30,11 @@ public class CallSuperIdIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class CodeGenOpIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class ConcatIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class ConvertF4Ins extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class ConvertMIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class ConvertMPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,11 +31,11 @@ public class DecLocalPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class DecodeIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,11 +31,11 @@ public class DecrementPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class DelDescendantsIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class DeletePropertyLateIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class DividePIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class DoubleToAtomIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class FindPropGlobalIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,11 +31,11 @@ public class IncLocalPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,11 +31,11 @@ public class IncrementPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -17,9 +17,9 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -30,11 +30,11 @@ public class InvalidIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -17,9 +17,9 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -30,11 +30,11 @@ public class Lf32x4Ins extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class MarkIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class ModuloPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class MultiplyPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class NegatePIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class PrologueIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class PushConstantIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class PushDNanIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class PushDecimalIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -17,9 +17,9 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -30,11 +30,11 @@ public class PushFloat4Ins extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class SendEnterIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class SetPropertyLateIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -17,9 +17,9 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -30,11 +30,11 @@ public class Sf32x4Ins extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
}

View File

@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -32,12 +32,12 @@ public class SubtractPIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class SweepIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class VerifyOpIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class VerifyPassIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -31,12 +31,12 @@ public class WbIns extends InstructionDefinition {
}
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
return super.execute(lda, constants, ins);
super.verify(lda, constants, ins);
}
@Override

View File

@@ -20,9 +20,9 @@ import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2TypeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item;
@@ -46,7 +46,7 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
Multiname multiname = (Multiname) ins.getParam(constants, 0);
if (multiname == null) {
throw new AVM2TypeErrorException(1034);
throw new AVM2TypeErrorException(1034, lda.isDebug());
}
Object value = lda.operandStack.pop();
@@ -54,13 +54,22 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT
value = Null.INSTANCE;
}
//push and pop coerced value to specified type
EcmaType type = EcmaScript.type(value);
if (type != EcmaType.NULL && type != EcmaType.OBJECT) {
throw new AVM2TypeErrorException(1034);
switch (type) {
case NUMBER:
case BOOLEAN:
lda.operandStack.push(EcmaScript.toString(value));
break;
case NULL:
case OBJECT:
case STRING:
lda.operandStack.push(value);
break;
default:
throw new AVM2TypeErrorException(1034, lda.isDebug());
}
//push and pop coerced value to specified type
lda.operandStack.push(value);
return true;
}

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.ecma.Null;
import com.jpexs.decompiler.flash.ecma.Undefined;
import com.jpexs.decompiler.graph.DottedChain;
@@ -47,7 +48,7 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert
if (value == Null.INSTANCE) {
lda.operandStack.push(value);
} else {
lda.operandStack.push(value.toString());
lda.operandStack.push(EcmaScript.toString(value));
}
return true;

View File

@@ -42,11 +42,11 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2TypeErrorException {
Object obj = lda.operandStack.peek();
if (EcmaScript.type(obj) == EcmaType.NULL) {
throw new AVM2TypeErrorException(1009);
throw new AVM2TypeErrorException(1009, lda.isDebug());
}
if (EcmaScript.type(obj) == EcmaType.UNDEFINED) {
throw new AVM2TypeErrorException(1010);
throw new AVM2TypeErrorException(1010, lda.isDebug());
}
//throw if pop is not object

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TranslateStack;
@@ -38,7 +39,7 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
Object obj = lda.operandStack.pop();
lda.operandStack.push(obj.toString());
lda.operandStack.push(EcmaScript.toString(obj));
return true;
}

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.EscapeXAttrAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TranslateStack;
import java.util.List;
@@ -35,8 +36,8 @@ public class EscXAttrIns extends InstructionDefinition {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
String s = lda.operandStack.pop().toString();
//escape
String s = EcmaScript.toString(lda.operandStack.pop());
// todo: escape
lda.operandStack.push(s);
return true;
}

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.EscapeXElemAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TranslateStack;
import java.util.List;
@@ -35,8 +36,8 @@ public class EscXElemIns extends InstructionDefinition {
@Override
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
String s = lda.operandStack.pop().toString();
//escape
String s = EcmaScript.toString(lda.operandStack.pop());
// todo: escape
lda.operandStack.push(s);
return true;
}

View File

@@ -163,12 +163,7 @@ public final class MethodBody implements Cloneable {
}
public void markOffsets() {
long offset = 0;
AVM2Code code = getCode();
for (int i = 0; i < code.code.size(); i++) {
code.code.get(i).offset = offset;
offset += code.code.get(i).getBytesLength();
}
getCode().markOffsets();
}
@Override

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.swf4.ActionAsciiToChar;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -51,11 +52,11 @@ public class AsciiToCharActionItem extends ActionItem {
@Override
public Object getResult() {
return getResult(value.getResultAsNumber());
return getResult(value.getResult());
}
public static String getResult(Double ascii) {
int res = (int) (double) ascii;
public static String getResult(Object ascii) {
int res = (char) EcmaScript.toInt32(ascii);
if (res == 0) {
return "";
}

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.swf4.ActionMBAsciiToChar;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -51,11 +52,11 @@ public class MBAsciiToCharActionItem extends ActionItem {
@Override
public Object getResult() {
return getResult(value.getResultAsNumber());
return getResult(value.getResult());
}
public static String getResult(Double ascii) {
int res = (int) (double) ascii;
public static String getResult(Object ascii) {
int res = (char) EcmaScript.toInt32(ascii);
if (res == 0) {
return "";
}

View File

@@ -46,7 +46,7 @@ public class MBStringExtractActionItem extends ActionItem {
}
public MBStringExtractActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem index, GraphTargetItem count) {
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
this.index = index;
this.count = count;
}
@@ -80,10 +80,10 @@ public class MBStringExtractActionItem extends ActionItem {
public static String getResult(Object count, Object index, Object value) {
String str = EcmaScript.toString(value);
int idx = (int) (double) EcmaScript.toNumberAs2(index);
int idx = EcmaScript.toInt32(index);
idx--; // index seems to be 1 based
int cnt = (int) (double) EcmaScript.toNumberAs2(count);
int cnt = EcmaScript.toInt32(count);
/*if (idx < 0) {
idx = str.length() + idx;

View File

@@ -36,7 +36,7 @@ public class StringExtractActionItem extends ActionItem {
public GraphTargetItem count;
public StringExtractActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem index, GraphTargetItem count) {
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
this.index = index;
this.count = count;
}
@@ -69,10 +69,10 @@ public class StringExtractActionItem extends ActionItem {
public static String getResult(Object count, Object index, Object value) {
String str = EcmaScript.toString(value);
int idx = (int) (double) EcmaScript.toNumberAs2(index);
int idx = EcmaScript.toInt32(index);
idx--; // index seems to be 1 based
int cnt = (int) (double) EcmaScript.toNumberAs2(count);
int cnt = EcmaScript.toInt32(count);
/*if (idx < 0) {
idx = str.length() + idx;

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.swf4.ActionToInteger;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -51,11 +52,11 @@ public class ToIntegerActionItem extends ActionItem {
@Override
public Object getResult() {
return getResult(value.getResultAsNumber());
return getResult(value.getResult());
}
public static long getResult(Double num) {
return Math.round(num);
public static long getResult(Object num) {
return EcmaScript.toInt32(num);
}
@Override

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.swf5.ActionBitAnd;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -34,11 +35,11 @@ public class BitAndActionItem extends BinaryOpItem {
@Override
public Object getResult() {
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
return getResult(rightSide.getResult(), leftSide.getResult());
}
public static long getResult(Double rightResult, Double leftResult) {
return ((long) (double) leftResult) & ((long) (double) rightResult);
public static long getResult(Object rightResult, Object leftResult) {
return EcmaScript.toInt32(leftResult) & EcmaScript.toInt32(rightResult);
}
@Override

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.swf5.ActionBitOr;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -34,11 +35,11 @@ public class BitOrActionItem extends BinaryOpItem {
@Override
public Object getResult() {
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
return getResult(rightSide.getResult(), leftSide.getResult());
}
public static long getResult(Double rightResult, Double leftResult) {
return ((long) (double) leftResult) | ((long) (double) rightResult);
public static long getResult(Object rightResult, Object leftResult) {
return EcmaScript.toInt32(leftResult) | EcmaScript.toInt32(rightResult);
}
@Override

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
import com.jpexs.decompiler.flash.action.swf5.ActionBitXor;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
@@ -37,11 +38,11 @@ public class BitXorActionItem extends BinaryOpItem {
@Override
public Object getResult() {
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
return getResult(rightSide.getResult(), leftSide.getResult());
}
public static long getResult(Double rightResult, Double leftResult) {
return ((long) (double) leftResult) ^ ((long) (double) rightResult);
public static long getResult(Object rightResult, Object leftResult) {
return EcmaScript.toInt32(leftResult) ^ EcmaScript.toInt32(rightResult);
}
@Override

View File

@@ -46,7 +46,7 @@ public class EqActionItem extends BinaryOpItem implements LogicalOpItem, EqualsT
public static Boolean getResult(Object rightResult, Object leftResult, boolean version2) {
if (version2) {
return EcmaScript.equals(leftResult, rightResult);
return EcmaScript.equals(true, leftResult, rightResult);
} else {
//For SWF 4 and older, it should return 1 or 0
return (Action.toFloatPoint(leftResult) == Action.toFloatPoint(rightResult));

View File

@@ -44,13 +44,13 @@ public class GtActionItem extends BinaryOpItem implements LogicalOpItem {
}
public static Object getResult(Object rightResult, Object leftResult) {
Object ret = EcmaScript.compare(rightResult, leftResult, true);
Object ret = EcmaScript.compare(leftResult, rightResult, true);
if (ret == Undefined.INSTANCE) {
return ret;
}
int reti = (int) ret;
return reti == -1;
return reti == 1;
}
@Override

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.swf5.ActionBitLShift;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -34,11 +35,11 @@ public class LShiftActionItem extends BinaryOpItem {
@Override
public Object getResult() {
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
return getResult(rightSide.getResult(), leftSide.getResult());
}
public static int getResult(Double rightResult, Double leftResult) {
return ((int) (double) leftResult) << ((int) (double) rightResult);
public static int getResult(Object rightResult, Object leftResult) {
return EcmaScript.toInt32(leftResult) << EcmaScript.toInt32(rightResult);
}
@Override

View File

@@ -41,13 +41,13 @@ public class LeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte
@Override
public Object getResult() {
Object ret = EcmaScript.compare(rightSide.getResult(), leftSide.getResult(), true);
Object ret = EcmaScript.compare(leftSide.getResult(), rightSide.getResult(), true);
if (ret == Undefined.INSTANCE) {
return ret;
}
int reti = (int) ret;
return reti != -1;
return reti != 1;
}
@Override

View File

@@ -38,10 +38,10 @@ public class ModuloActionItem extends BinaryOpItem {
}
public static Number getResult(Double rightResult, Double leftResult) {
if (Double.isNaN(rightResult) || Double.compare(rightResult, 0) == 0) {
if (Double.isNaN(leftResult) || Double.isNaN(rightResult) || Double.compare(rightResult, 0) == 0) {
return Double.NaN;
}
return ((long) (double) leftResult) % ((long) (double) rightResult);
return ((double) leftResult) % ((double) rightResult);
}
@Override

View File

@@ -42,7 +42,7 @@ public class NeqActionItem extends BinaryOpItem implements LogicalOpItem, Invert
@Override
public Object getResult() {
if (version2) {
return !EcmaScript.equals(leftSide.getResult(), rightSide.getResult());
return !EcmaScript.equals(true, leftSide.getResult(), rightSide.getResult());
} else {
//For SWF 4 and older, it should return 1 or 0
return (Action.toFloatPoint(leftSide.getResult()) != Action.toFloatPoint(rightSide.getResult()));

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
import com.jpexs.decompiler.flash.action.swf5.ActionBitRShift;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.graph.CompilationException;
import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
@@ -34,12 +35,12 @@ public class RShiftActionItem extends BinaryOpItem {
@Override
public Object getResult() {
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
return getResult(rightSide.getResult(), leftSide.getResult());
}
public static long getResult(Double rightResult, Double leftResult) {
long rightResult2 = ((long) (double) rightResult) & 0x1f;
return ((long) (double) leftResult) >> rightResult2;
public static long getResult(Object rightResult, Object leftResult) {
long rightResult2 = EcmaScript.toInt32(rightResult) & 0x1f;
return EcmaScript.toInt32(leftResult) >> rightResult2;
}
@Override

View File

@@ -43,8 +43,7 @@ public class StrictEqActionItem extends BinaryOpItem implements LogicalOpItem, I
public static boolean getResult(Object rightResult, Object leftResult) {
Object x = leftResult;
Object y = rightResult;
return EcmaScript.type(x) == EcmaScript.type(y)
&& EcmaScript.equals(x, y);
return EcmaScript.strictEquals(true, x, y);
}
@Override

View File

@@ -39,8 +39,7 @@ public class StrictNeqActionItem extends BinaryOpItem implements LogicalOpItem,
public Object getResult() {
Object x = leftSide.getResult();
Object y = rightSide.getResult();
return EcmaScript.type(x) != EcmaScript.type(y)
|| (!EcmaScript.equals(x, y));
return !EcmaScript.strictEquals(true, x, y);
}
@Override

View File

@@ -45,7 +45,7 @@ public class ActionAsciiToChar extends Action {
return false;
}
lda.stack.push(AsciiToCharActionItem.getResult(lda.popAsNumber()));
lda.stack.push(AsciiToCharActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -44,7 +44,7 @@ public class ActionMBAsciiToChar extends Action {
return false;
}
lda.stack.push(MBAsciiToCharActionItem.getResult(lda.popAsNumber()));
lda.stack.push(MBAsciiToCharActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -46,6 +46,7 @@ import com.jpexs.helpers.Helper;
import com.jpexs.helpers.utf8.Utf8Helper;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
@@ -254,6 +255,13 @@ public class ActionPush extends Action {
updateLength();
}
public ActionPush(Object[] values) {
super(0x96, 0);
this.values = new ArrayList<>();
this.values.addAll(Arrays.asList(values));
updateLength();
}
public ActionPush(FlasmLexer lexer, List<String> constantPool) throws IOException, ActionParseException {
super(0x96, 0);
this.constantPool = constantPool;

View File

@@ -44,7 +44,7 @@ public class ActionToInteger extends Action {
return false;
}
lda.stack.push(ToIntegerActionItem.getResult(lda.popAsNumber()));
lda.stack.push(ToIntegerActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -44,7 +44,7 @@ public class ActionBitAnd extends Action {
return false;
}
lda.stack.push(BitAndActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
lda.stack.push(BitAndActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -44,7 +44,7 @@ public class ActionBitLShift extends Action {
return false;
}
lda.stack.push(LShiftActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
lda.stack.push(LShiftActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -44,7 +44,7 @@ public class ActionBitOr extends Action {
return false;
}
lda.stack.push(BitOrActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
lda.stack.push(BitOrActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -44,7 +44,7 @@ public class ActionBitRShift extends Action {
return false;
}
lda.stack.push(RShiftActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
lda.stack.push(RShiftActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -44,7 +44,7 @@ public class ActionBitXor extends Action {
return false;
}
lda.stack.push(BitXorActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
lda.stack.push(BitXorActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -69,6 +69,10 @@ public class EcmaScript {
return Double.NaN;
}
if (o instanceof String && ((String) o).isEmpty()) {
return Double.NaN;
}
return toNumber(o);
}
@@ -184,6 +188,15 @@ public class EcmaScript {
if (sx.equals(sy)) {
return 0;
}
if (as2) {
// in AS2 an empty string is greater than a non-empty string...
if (sx.isEmpty()) {
return 1;
}
if (sy.isEmpty()) {
return -1;
}
}
if (sx.startsWith(sy)) {
return 1;
}
@@ -213,14 +226,22 @@ public class EcmaScript {
}
public static boolean strictEquals(Object x, Object y) {
return strictEquals(false, x, y);
}
public static boolean equals(Object x, Object y) {
return equals(false, x, y);
}
public static boolean strictEquals(boolean as2, Object x, Object y) {
if (type(x) != type(y)) {
return false;
}
return equals(x, y);
return equals(as2, x, y);
}
public static boolean equals(Object x, Object y) {
public static boolean equals(boolean as2, Object x, Object y) {
EcmaType typeX = type(x);
EcmaType typeY = type(y);
if (typeX == typeY) {
@@ -279,16 +300,16 @@ public class EcmaScript {
}
if ((typeX == EcmaType.NUMBER) && (typeY == EcmaType.STRING)) {
return equals(x, toNumber(y));
return equals(as2, x, as2 ? toNumberAs2(y) : toNumber(y));
}
if ((typeX == EcmaType.STRING) && (typeY == EcmaType.NUMBER)) {
return equals(toNumber(x), y);
return equals(as2, as2 ? toNumberAs2(x) : toNumber(x), y);
}
if (typeX == EcmaType.BOOLEAN) {
return equals(toNumber(x), y);
return equals(as2, as2 ? toNumberAs2(x) : toNumber(x), y);
}
if (typeY == EcmaType.BOOLEAN) {
return equals(x, toNumber(y));
return equals(as2, x, as2 ? toNumberAs2(y) : toNumber(y));
}
if (typeX == EcmaType.STRING || typeX == EcmaType.NUMBER) {
//y is object