From 5b81a4819a249921085f6596927f9939dffc46e7 Mon Sep 17 00:00:00 2001 From: CircleShift Date: Fri, 5 Dec 2025 01:03:25 -0500 Subject: [tnslc] Fix pointer issue with find func --- tnslc/compile/module.tnsl | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'tnslc/compile/module.tnsl') diff --git a/tnslc/compile/module.tnsl b/tnslc/compile/module.tnsl index 38653da..d2f1525 100644 --- a/tnslc/compile/module.tnsl +++ b/tnslc/compile/module.tnsl @@ -183,29 +183,34 @@ struct Module { /; if ((lvl + 1) < key`.count) ~Module m - ~uint8 str = key`.get(lvl) + ~~uint8 str = key`.get(lvl) + _printf("Trying to find sub '\0") + _printf(str`) + _printf("' in module '\0") + _printf(self.name) + _printf("'\n\0") + /; loop (int i = 0; i < self.subs.count) [i++] m = self.subs.get(i) - /; if (utils.strcmp(str, m`.name) == true) + /; if (utils.strcmp(str`, m`.name) == true) ~void v = m._find(stype, key, lvl + 1) /; if (v != NULL) return v ;/ - return NULL ;/ ;/ ;; else - ~uint8 str = key`.get(key`.count - 1) + ~~uint8 str = key`.get(key`.count - 1) ~void out = NULL /; if (stype == SEARCH_VAR) - out = self._find_var(str) + out = self._find_var(str`) ;; else if (stype == SEARCH_STRUCT) - out = self._find_struct(str) + out = self._find_struct(str`) ;; else if (stype == SEARCH_FUNC) - out = self._find_func(str) + out = self._find_func(str`) ;; else if (stype == SEARCH_SUB) - out = self._find_sub(str) + out = self._find_sub(str`) ;/ /; if (out !== NULL) -- cgit v1.2.3