We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a06d606 + f0b31cd commit e1d867fCopy full SHA for e1d867f
source/backends/arm64.d
@@ -1101,14 +1101,23 @@ class BackendARM64 : CompilerBackend {
1101
if (GlobalExists(name)) {
1102
auto var = GetGlobal(name);
1103
1104
- LoadAddress("x9", format("__global_%s", node.func.Sanitise()));
+ LoadAddress("x9", format("__global_%s", name.Sanitise()));
1105
+ if (var.type.ptr) {
1106
+ output ~= "ldr x9, [x9]\n";
1107
+ }
1108
output ~= format("add x9, x9, #%d\n", offset);
1109
output ~= "str x9, [x19], #8\n";
1110
}
1111
else if (VariableExists(name)) {
1112
auto var = GetVariable(name);
1113
- output ~= format("add x9, x20, #%d\n", var.offset + offset);
1114
1115
+ output ~= format("add x9, x20, #%d\n", var.offset);
1116
1117
+ output ~= format("add x9, x9, #%d\n", offset);
1118
+ } else {
1119
+ output ~= format("add x9, x20, #%d\n", var.offset + offset);
1120
1121
1122
1123
else {
0 commit comments