Skip to content

Commit a336eca

Browse files
committed
Fix possible stack corruption in arm64 C calls
1 parent 48e8600 commit a336eca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

source/backends/arm64.d

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ class BackendARM64 : CompilerBackend {
426426
output ~= format("ldr x%d, [x19, #-8]!\n", reg);
427427
}
428428

429+
output ~= "and sp, x20, ~0xf\n";
429430
output ~= format("bl %s\n", ExternSymbol(word.symbolName));
430431

431432
if (!word.isVoid) {

0 commit comments

Comments
 (0)