Skip to content

Commit f010ec4

Browse files
committed
fix broken C interop
1 parent e2c3b23 commit f010ec4

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

source/backends/x86_64.d

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -652,15 +652,8 @@ class BackendX86_64 : CompilerBackend {
652652
output ~= "mov rbp, rsp\n";
653653
output ~= "and rsp, 0xFFFFFFFFFFFFFFF0\n";
654654

655-
size_t alignSize = word.params.length * 8;
656-
657-
while (alignSize % 16 != 0) {
658-
alignSize += 8;
659-
}
660-
alignSize -= word.params.length * 8;
661-
662-
if (alignSize > 0) {
663-
output ~= format("sub rsp, %d\n", alignSize);
655+
if ((word.params.length > 6) && (word.params.length % 2 != 0)) {
656+
output ~= format("sub rsp, 8\n");
664657
}
665658

666659
if (word.params.length > 6) {

0 commit comments

Comments
 (0)