mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 04:15:11 +00:00
action long arguments (e.g InitProerty count parameter) can be anything on the stack, use EcmaScript.toNumber to convert it to integer (long)
This commit is contained in:
@@ -56,6 +56,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionWith;
|
||||
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
|
||||
import com.jpexs.decompiler.flash.action.swf7.ActionTry;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
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.flash.exporters.modes.ScriptExportMode;
|
||||
@@ -729,10 +730,9 @@ public abstract class Action implements GraphSourceItem {
|
||||
protected long popLong(TranslateStack stack) {
|
||||
GraphTargetItem item = stack.pop();
|
||||
if (item instanceof DirectValueActionItem) {
|
||||
if (((DirectValueActionItem) item).value instanceof Long) {
|
||||
return (long) (Long) ((DirectValueActionItem) item).value;
|
||||
}
|
||||
return (long) (double) EcmaScript.toNumber(((DirectValueActionItem) item).value);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -332,15 +332,16 @@ public class ActionPush extends Action {
|
||||
|
||||
public String toString(int i) {
|
||||
String ret;
|
||||
if (values.get(i) instanceof ConstantIndex) {
|
||||
((ConstantIndex) values.get(i)).constantPool = constantPool;
|
||||
ret = ((ConstantIndex) values.get(i)).toString();
|
||||
} else if (values.get(i) instanceof String) {
|
||||
ret = "\"" + Helper.escapeActionScriptString((String) values.get(i)) + "\"";
|
||||
} else if (values.get(i) instanceof RegisterNumber) {
|
||||
ret = ((RegisterNumber) values.get(i)).toStringNoName();
|
||||
Object value = values.get(i);
|
||||
if (value instanceof ConstantIndex) {
|
||||
((ConstantIndex) value).constantPool = constantPool;
|
||||
ret = ((ConstantIndex) value).toString();
|
||||
} else if (value instanceof String) {
|
||||
ret = "\"" + Helper.escapeActionScriptString((String) value) + "\"";
|
||||
} else if (value instanceof RegisterNumber) {
|
||||
ret = ((RegisterNumber) value).toStringNoName();
|
||||
} else {
|
||||
ret = values.get(i).toString();
|
||||
ret = value.toString();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user