mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 21:21:01 +00:00
AS2 execution fixes
This commit is contained in:
+2
-1
@@ -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;
|
||||
|
||||
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user