summaryrefslogtreecommitdiff
path: root/tnslc/compile/codegen.tnsl
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2025-12-08 21:59:55 -0500
committerKai Gunger <kgunger12@gmail.com>2025-12-08 21:59:55 -0500
commit38723762d5e3c61dab16d6e40bc905b53e21baca (patch)
treea8a3211b089f837d78ac5de714cb83b97262c0ea /tnslc/compile/codegen.tnsl
parent8bb2e3bdb00341dcd8b6fd4d272b2c96a708acb3 (diff)
fix memory issues with type resolution
Diffstat (limited to 'tnslc/compile/codegen.tnsl')
-rw-r--r--tnslc/compile/codegen.tnsl5
1 files changed, 2 insertions, 3 deletions
diff --git a/tnslc/compile/codegen.tnsl b/tnslc/compile/codegen.tnsl
index ef668c7..2dfe9d5 100644
--- a/tnslc/compile/codegen.tnsl
+++ b/tnslc/compile/codegen.tnsl
@@ -18,10 +18,10 @@
# Transform into a module tree
Module mod
mod.init(~ast, ~buffer)
+ _gen_prims(~mod)
mod.update_children()
# Compile code
- _gen_prims(~mod)
mod.compile(~buffer)
mod.print()
@@ -39,13 +39,12 @@
/; _gen_prim(~Module m, int size, ~uint8 id)
~Module mds = m`._create_methods(id)
- mds`.parent = m
Var t
Struct s
s.size = size
- s.methods = mds
+ s.methods = NULL
s.members.init(len t)
s.name = utils.strcpy(id)
s._up = NULL