Skip to content

Commit 9677865

Browse files
jgarzikclaude
andcommitted
Widen the generated-code alignment check
REDIM PRESERVE, string concatenation, PRINT USING, SWAP and a fixed-length string assignment all make calls from sequences that manipulate rsp, and all already pair an odd push with `sub rsp, 8`. Covering them keeps that true. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 1566b42 commit 9677865

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/codegen/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,12 @@ fn test_generated_calls_are_stack_aligned() {
10811081
"array subscript",
10821082
"DIM A(3)\nA(1) = 2\nPRINT MID$(\"abcdef\", A(1), 2)\n",
10831083
),
1084+
("REDIM PRESERVE", "DIM A(3)\nREDIM PRESERVE A(5)\n"),
1085+
("REDIM plain", "DIM A(3)\nREDIM A(5)\n"),
1086+
("string concat", "A$ = \"x\" + \"y\"\n"),
1087+
("PRINT USING", "PRINT USING \"##.##\"; 1.5\n"),
1088+
("SWAP", "A% = 1 : B% = 2\nSWAP A%, B%\n"),
1089+
("fixed string", "DIM S AS STRING * 4\nS = \"xy\"\n"),
10841090
];
10851091

10861092
let mut problems = Vec::new();

0 commit comments

Comments
 (0)