diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-08-10 01:16:26 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-08-10 01:16:26 -0400 |
commit | 9ab49df341025eca8e641ee539355edb15e0fff2 (patch) | |
tree | 97cd97561797c219ef9d3993ada51e5ed08984a4 | |
parent | 9dd5e57a4526702d64276c47451fa19c2032e990 (diff) |
Fix allocation logic
-rw-r--r-- | tnslc/compiler.tnsl | 8 |
1 files 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 |