From 9ab49df341025eca8e641ee539355edb15e0fff2 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 10 Aug 2023 01:16:26 -0400 Subject: Fix allocation logic --- tnslc/compiler.tnsl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tnslc/compiler.tnsl b/tnslc/compiler.tnsl index e455bb1..eb77b22 100644 --- a/tnslc/compiler.tnsl +++ b/tnslc/compiler.tnsl @@ -108,13 +108,13 @@ struct Path { /; if (i < self.path_count - 1) - pth = _alloc(new_len + 2) + pth = _realloc(pth, new_len + 2) pth{new_len} = '/' pth{new_len + 1} = 0 old_len++ new_len++ ;; else - pth = _alloc(new_len + 1) + pth = _realloc(pth, new_len + 1) pth{new_len} = 0 ;/ @@ -149,6 +149,10 @@ struct Path { ;/ ;/ +# +# +# + /; compile (Path in, out) ;/ \ No newline at end of file -- cgit v1.2.3