Fixed: #2618 AS1/2 increment/decrement using PushDuplicate

This commit is contained in:
Jindra Petřík
2026-02-09 16:17:29 +01:00
parent f6224d6252
commit a2d10314a0
3 changed files with 22 additions and 3 deletions

View File

@@ -572,4 +572,19 @@ public class ActionScript2AssemblerTest extends ActionScript2TestBase {
+ "}\n"
+ "}");
}
@Test
public void testIncrementDup() {
String res = decompilePcode("Push \"this\"\n"
+ "GetVariable\n"
+ "PushDuplicate\n"
+ "Push \"myVar\"\n"
+ "GetMember\n"
+ "Increment\n"
+ "Push \"myVar\"\n"
+ "StackSwap\n"
+ "SetMember");
res = cleanPCode(res);
assertEquals(res, "this.myVar++;");
}
}