mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-03 15:15:32 +00:00
Fixed #2234 AS1/2 postincrement/decrement inside DefineFunction2
This commit is contained in:
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SecondPassData;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.decompiler.graph.model.AnyItem;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -59,6 +60,9 @@ public class ActionPop extends Action {
|
||||
@Override
|
||||
public void translate(Map<String, Map<String, Trait>> uninitializedClassTraits, SecondPassData secondPassData, boolean insideDoInitAction, GraphSourceItem lineStartAction, TranslateStack stack, List<GraphTargetItem> output, HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, int staticOperation, String path) {
|
||||
GraphTargetItem val = stack.pop();
|
||||
if (val instanceof AnyItem) {
|
||||
return;
|
||||
}
|
||||
output.add(val);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ import com.jpexs.decompiler.graph.GraphSourceItemPos;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.SecondPassData;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.decompiler.graph.model.AnyItem;
|
||||
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@@ -148,7 +149,7 @@ public class ActionStoreRegister extends Action implements StoreTypeAction {
|
||||
if (!stack.isEmpty() && stack.peek().valueEquals(obj)) {
|
||||
stack.pop();
|
||||
stack.push(new PostIncrementActionItem(this, lineStartAction, obj));
|
||||
stack.push(obj);
|
||||
stack.push(new AnyItem()); //to avoid leaving popped item on output
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -157,7 +158,7 @@ public class ActionStoreRegister extends Action implements StoreTypeAction {
|
||||
if (!stack.isEmpty() && stack.peek().valueEquals(obj)) {
|
||||
stack.pop();
|
||||
stack.push(new PostDecrementActionItem(this, lineStartAction, obj));
|
||||
stack.push(obj);
|
||||
stack.push(new AnyItem()); //to avoid leaving popped item on output
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user