mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: generate OP_SETIDX from attribute assignments.
This commit is contained in:
@@ -1888,7 +1888,12 @@ gen_assignment(codegen_scope *s, node *tree, node *rhs, int sp, int val)
|
||||
genop_2(s, OP_ARYPUSH, cursp(), 1);
|
||||
}
|
||||
s->sp = call;
|
||||
genop_3(s, noself ? OP_SSEND : OP_SEND, cursp(), new_sym(s, attrsym(s, mid)), n);
|
||||
if (mid == MRB_OPSYM_2(s->mrb, aref) && n == 2) {
|
||||
genop_1(s, OP_SETIDX, cursp());
|
||||
}
|
||||
else {
|
||||
genop_3(s, noself ? OP_SSEND : OP_SEND, cursp(), new_sym(s, attrsym(s, mid)), n);
|
||||
}
|
||||
if (safe) {
|
||||
dispatch(s, skip);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user