diff options
| author | 2025-10-16 17:53:42 +0200 | |
|---|---|---|
| committer | 2025-10-16 17:53:42 +0200 | |
| commit | d051c17c70c86b3c9bbc0a0761203d97e8c662d0 (patch) | |
| tree | 0a4b1e27b5a7ef3092a476952727def0900d496a /regalloc.c | |
| parent | 77b13b42643991fc8c2b8942ca167eb7bf156908 (diff) | |
various little bugs
Diffstat (limited to 'regalloc.c')
| -rw-r--r-- | regalloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -82,7 +82,7 @@ fixlive(struct function *fn) struct bitset definedbuf[4] = {0}; struct bitset *defined = definedbuf; - if (BSSIZE(ninstr) >= sizeof(definedbuf)) + if (BSSIZE(ninstr) >= arraylength(definedbuf)) defined = xcalloc(sizeof *defined * BSSIZE(ninstr)); npendingphi = 0; @@ -1010,7 +1010,7 @@ devirt(struct rega *ra, struct block *blk) if (nspill > 0) assert(ins->op != Ocall); /* devirtualize destination */ - alloc = (it = &ra->intervals.temps[temp]) && it->nrange ? &it->alloc : NULL; + alloc = temp < ra->intervals.count && (it = &ra->intervals.temps[temp]) && it->nrange ? &it->alloc : NULL; if (alloc && alloc->t == ASTACK) { int store = Ostore1 + ilog2(cls2siz[insrescls(*ins)]); /* t was spilled, gen store */ |