use new vector functions instead of reallocs

This commit is contained in:
Quentin Carbonneaux 2015-10-06 20:42:54 -04:00
parent 1f61873799
commit 99ad19546d
5 changed files with 106 additions and 60 deletions

View file

@ -611,9 +611,9 @@ parsefn()
err("empty file");
if (curb->jmp.type == JXXX)
err("last block misses jump");
fn->tmp = alloc(ntmp * sizeof tmp[0]);
fn->tmp = valloc(ntmp, sizeof tmp[0]);
memcpy(fn->tmp, tmp, ntmp * sizeof tmp[0]);
fn->con = alloc(ncon * sizeof con[0]);
fn->con = valloc(ncon, sizeof con[0]);
memcpy(fn->con, con, ncon * sizeof con[0]);
fn->ntmp = ntmp;
fn->ncon = ncon;