summaryrefslogtreecommitdiff
path: root/tnslc/compile/var.tnsl
diff options
context:
space:
mode:
Diffstat (limited to 'tnslc/compile/var.tnsl')
-rw-r--r--tnslc/compile/var.tnsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/tnslc/compile/var.tnsl b/tnslc/compile/var.tnsl
index f41d233..477a4fb 100644
--- a/tnslc/compile/var.tnsl
+++ b/tnslc/compile/var.tnsl
@@ -920,7 +920,7 @@ struct Var {
buf`.add_c(" ; putting struct address into register\n\0")
# Initial deref or move
- /; if (self.ptrc.count > 0)
+ /; if (self.ptrc.count > 1)
buf`.add_c(" mov \0")
;; else
buf`.add_c(" lea \0")
@@ -1670,6 +1670,7 @@ struct Var {
/; if (self.is_ref() == true)
self._set_struct_r(buf, 5)
out.loc = 5
+ out.ptr_push(0)
;; else
out.loc = self.loc
out.offset = out.offset + self.offset