factor vector duplication in vdup()

This commit is contained in:
Quentin Carbonneaux 2015-10-05 21:27:02 -04:00
parent 60aacea0c3
commit a83174f447
6 changed files with 17 additions and 24 deletions

View file

@ -401,10 +401,8 @@ spill(Fn *fn)
p->to = slot(p->to.val);
}
b->in = v;
free(b->ins);
b->nins = &insb[NIns] - curi;
b->ins = alloc(b->nins * sizeof(Ins));
memcpy(b->ins, curi, b->nins * sizeof(Ins));
vdup(&b->ins, curi, b->nins * sizeof(Ins));
}
/* align the locals to a 16 byte boundary */