summaryrefslogtreecommitdiff
path: root/tests/arr2.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-16 20:55:18 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-16 20:55:18 -0400
commit63ea50be35afb6d7b9dbcd20fe3c31de6187858e (patch)
tree6356cb27f1285379aa5c46d7863ba7a25364e3f2 /tests/arr2.toc
parent6855c6e752e4e4f2f37702477a3b461a51bbc614 (diff)
updated tests, fixed bugs
Diffstat (limited to 'tests/arr2.toc')
-rw-r--r--tests/arr2.toc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/arr2.toc b/tests/arr2.toc
index e016cf2..9d6aa34 100644
--- a/tests/arr2.toc
+++ b/tests/arr2.toc
@@ -1,3 +1,4 @@
+#include "mem.toc";
puti ::= fn(x: int) {
#C("#ifndef __TINYC__
extern int printf(const char *fmt, ...);
@@ -26,7 +27,7 @@ Arr ::= fn (t :: Type) Type {
arr_add ::= fn(t ::=, a : &Arr(t), x : t) {
if a.len >= a.cap {
a.cap = a.cap * 2 + 2;
- new_data := new(t, a.cap);
+ new_data := news(t, a.cap);
for i := 0..a.len-1 {
new_data[i] = a.data[i];
}