aboutsummaryrefslogtreecommitdiffhomepage
path: root/regalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'regalloc.c')
-rw-r--r--regalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regalloc.c b/regalloc.c
index c3afe70..ed5af2c 100644
--- a/regalloc.c
+++ b/regalloc.c
@@ -257,7 +257,7 @@ regalloc(struct function *fn)
struct rega ra = {0};
vinit(&stkslotrefs, stkslotrefsbuf, arraylength(stkslotrefsbuf));
- ra.allocs = xcalloc(ninstr * sizeof(struct alloc));
+ ra.allocs = xcalloc((ninstr*2 < MAXINSTR ? ninstr*2 : MAXINSTR) * sizeof(struct alloc));
ra.nfreegpr = mctarg->ngpr - popcnt(mctarg->rglob->u);
ra.nfreefpr = mctarg->nfpr;
for (int i = 0; i < MAXREGS; ++i)