Fixed: #2291 AS1/2 Incorrect var keyword placement causing registers to compile wrong

This commit is contained in:
Jindra Petřík
2024-09-23 21:52:25 +02:00
parent 2976829642
commit 236126dc84
10 changed files with 80 additions and 34 deletions
@@ -2775,7 +2775,7 @@ public class AVM2Code implements Cloneable {
//Check whether the command references internal traits of other package
ti.visitRecursively(new AbstractGraphTargetVisitor() {
@Override
public void visit(GraphTargetItem item) {
public boolean visit(GraphTargetItem item) {
if (item instanceof GetSlotAVM2Item) {
GetSlotAVM2Item gs = (GetSlotAVM2Item) item;
if ((gs.slotObject instanceof GlobalAVM2Item) && (initializerType == GraphTextWriter.TRAIT_SCRIPT_INITIALIZER)) {
@@ -2798,6 +2798,7 @@ public class AVM2Code implements Cloneable {
}
}
}
return true;
}
});
@@ -2277,9 +2277,9 @@ public class AVM2Graph extends Graph {
private boolean handled = false;
@Override
public void visit(GraphTargetItem item) {
public boolean visit(GraphTargetItem item) {
if (handled) {
return;
return false;
}
if ((item instanceof NextNameAVM2Item) || (item instanceof NextValueAVM2Item)) {
handled = true;
@@ -2293,7 +2293,9 @@ public class AVM2Graph extends Graph {
nn.localReg = hn.index;
kindRef.setVal(2);
}
return false;
}
return true;
}
});