aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2016-08-14 21:57:27 -0700
committerQuentin Carbonneaux <[email protected]>2016-08-15 22:55:08 -0700
commit3f8af2ba7b8f79bd577ca4f2fef5fb922494042d (patch)
treea24214b9ad4e601182cf75e947893c0f93367ef3 /parse.c
parent5ad8a2c6fe90554bb6ad425597be732328fe0e41 (diff)
specify the allocation function in vnew
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/parse.c b/parse.c
index 2e7726d..38c212e 100644
--- a/parse.c
+++ b/parse.c
@@ -261,7 +261,7 @@ lex()
return Tint;
}
if (c == '"') {
- tokval.str = vnew(0, 1);
+ tokval.str = vnew(0, 1, alloc);
for (i=0;; i++) {
c = fgetc(inf);
if (c == EOF)
@@ -425,7 +425,7 @@ parsecls(int *tyn)
*tyn = i;
return 4;
}
- err("undefined type");
+ err("undefined type :%s", tokval.str);
case Tw:
return Kw;
case Tl:
@@ -752,11 +752,11 @@ parsefn(int export)
curf = alloc(sizeof *curf);
curf->ntmp = 0;
curf->ncon = 1; /* first constant must be 0 */
- curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0]);
- curf->con = vnew(curf->ncon, sizeof curf->con[0]);
+ curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], alloc);
+ curf->con = vnew(curf->ncon, sizeof curf->con[0], alloc);
for (r=0; r<Tmp0; r++)
newtmp(0, r < XMM0 ? Kl : Kd, curf);
- bmap = vnew(nblk, sizeof bmap[0]);
+ bmap = vnew(nblk, sizeof bmap[0], alloc);
curf->con[0].type = CBits;
curf->export = export;
blink = &curf->start;
@@ -779,7 +779,7 @@ parsefn(int export)
err("empty function");
if (curb->jmp.type == Jxxx)
err("last block misses jump");
- curf->mem = vnew(0, sizeof curf->mem[0]);
+ curf->mem = vnew(0, sizeof curf->mem[0], alloc);
curf->nmem = 0;
curf->nblk = nblk;
curf->rpo = 0;