diff options
| author | 2023-06-20 19:04:48 +0200 | |
|---|---|---|
| committer | 2023-06-20 19:04:48 +0200 | |
| commit | c32792b810bd8a523a0a461ecc41adc367a82e7d (patch) | |
| tree | 2a60af72c2407c470d1a046b8a1ca87fcd4dac9e | |
| parent | 625827a1ed452af5ee4b4181ac378eb5409b3cda (diff) | |
fix out of bounds read
| -rw-r--r-- | amd64/isel.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/amd64/isel.c b/amd64/isel.c index 51b5ac1..3c0b9e7 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -119,6 +119,7 @@ selcall(struct function *fn, struct instr *ins, struct block *blk, int *curi) /* duplicate to reuse same TMP ref */ insertinstr(blk, (*curi)++, *ins); *ins = mkinstr(Ocopy, cls, mkref(RREG, call->abiret[0].reg)); + if (*curi + 1 < blk->ins.n) if (instrtab[blk->ins.p[*curi + 1]].op == Ocall2r) { ins = &instrtab[blk->ins.p[++*curi]]; *ins = mkinstr(Ocopy, ins->cls, mkref(RREG, call->abiret[1].reg)); |