mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5774 from dearblue/bidx-assert
Fixed assertion in `ARGUMENT_NORMALIZE()` for `bidx`.
This commit is contained in:
@@ -1958,9 +1958,14 @@ gen_assignment(codegen_scope *s, node *tree, node *rhs, int sp, int val)
|
||||
push(); pop();
|
||||
s->sp = call;
|
||||
if (mid == MRB_OPSYM_2(s->mrb, aref) && n == 2) {
|
||||
push_n(4); pop_n(4); /* self + idx + value + (invisible block for OP_SEND) */
|
||||
genop_1(s, OP_SETIDX, cursp());
|
||||
}
|
||||
else {
|
||||
int st = 2 /* self + block */ +
|
||||
(((n >> 0) & 0x0f) < 15 ? ((n >> 0) & 0x0f) : 1) +
|
||||
(((n >> 4) & 0x0f) < 15 ? ((n >> 4) & 0x0f) * 2 : 1);
|
||||
push_n(st); pop_n(st);
|
||||
genop_3(s, noself ? OP_SSEND : OP_SEND, cursp(), new_sym(s, attrsym(s, mid)), n);
|
||||
}
|
||||
if (safe) {
|
||||
|
||||
@@ -1256,7 +1256,7 @@ hash_new_from_regs(mrb_state *mrb, mrb_int argc, mrb_int idx)
|
||||
*(arg_info) = n | (nk<<4); \
|
||||
} \
|
||||
\
|
||||
mrb_assert(bidx < irep->nregs+(arg_base)); \
|
||||
mrb_assert(bidx < irep->nregs); \
|
||||
mrb_int new_bidx = (arg_base)+mrb_bidx(n, nk); \
|
||||
if ((insn) == OP_SEND) { \
|
||||
/* clear block argument */ \
|
||||
|
||||
Reference in New Issue
Block a user