summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tnslc/simple.tnsl4
-rw-r--r--tnslc/tnslc.tnsl10
2 files changed, 12 insertions, 2 deletions
diff --git a/tnslc/simple.tnsl b/tnslc/simple.tnsl
index 29113b7..ea517d4 100644
--- a/tnslc/simple.tnsl
+++ b/tnslc/simple.tnsl
@@ -7,7 +7,9 @@
asm "mov r8, rcx"
asm "mov r9, rdx"
+ ~uint8 a = ~str1{0}
+
# return 3
- return argc + len str1
+ return a`
;/
diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl
index 2695706..b80a2ab 100644
--- a/tnslc/tnslc.tnsl
+++ b/tnslc/tnslc.tnsl
@@ -2932,8 +2932,16 @@
/; if (layer` > 1)
;log_debug("Dot tmp variable generated")
- ;Variable tt = scope`.new_tmp_var(wk.data_type, out)
+ ;Variable tt
+
+ /; if (wk.is_ref())
+ ;tt = scope`.new_tmp_var({8, "void", {PTYPE.POINTER}, {}, 0}, out)
+ ;; else
+ ;tt = scope`.new_tmp_var(wk.data_type, out)
+ ;/
+
;tt.set_raw(wk, out)
+ ;tt.data_type = wk.data_type
;wk = tt
;; else if (layer` == 1)
;wk.move_register(2, out)