Skip to content

Commit a916f86

Browse files
authored
Merge pull request #21 from callisto-lang/main
merge main to exceptions
2 parents b88ccc4 + a5634ab commit a916f86

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/backends/lua.d

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -912,10 +912,9 @@ class BackendLua : CompilerBackend {
912912
scopeSize += var.Size();
913913

914914
if (var.type.hasDeinit) {
915-
output ~= format("lea rax, [rsp + %d\n]", var.offset);
916-
output ~= "mov [r15], rax\n";
917-
output ~= "add r15, 8\n";
918-
output ~= format("call __type_deinit_%s\n", Sanitise(var.type.name));
915+
output ~= format("mem[dsp] = vsp + %d\n", var.offset);
916+
output ~= "dsp = dsp + 1\n";
917+
output ~= format("type_deinit_%s()\n", var.type.name.Sanitise());
919918
}
920919
}
921920
output ~= format("vsp = vsp + %d\n", scopeSize);

0 commit comments

Comments
 (0)