Because of mruby#3504 `ci->nregs = bidx+1` was introduced in b64f087.
This led to the follow up error mruby#3551 whose fix introduced the `if (bidx >= ci->nregs)`
check in 071164b and the `stack_extend(mrb, ci->nregs)`
in 93d8029.
Then, the code causing mruby#3504 reappeared again in mruby#3590. The fix for it moved the code
dealing with the block in OP_SUPER from below the `cipush` to above the `cipush`
in d9fb8b6. The `if (bidx >= ci->nregs) { ... }` from
then on works with the original callinfo and not the pushed one. `ci->nregs` needed to
be modified for the pushed one because it is initialized to 0. But for the original ci
it is propertly set and a check is not needed.
The following input demonstrates a crash:
ASAN report:
This issue was reported by Dinko Galetic & Denis Kasak (https://hackerone.com/dgaletic).
The text was updated successfully, but these errors were encountered: