Too much peephole optimization in `gen_call`; fix #4091

It causes trouble for safe navigation operator.
parent b80e0ef7
...@@ -979,7 +979,7 @@ gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe) ...@@ -979,7 +979,7 @@ gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe)
codegen(s, tree->car, VAL); /* receiver */ codegen(s, tree->car, VAL); /* receiver */
if (safe) { if (safe) {
int recv = cursp()-1; int recv = cursp()-1;
gen_move(s, cursp(), recv, 0); gen_move(s, cursp(), recv, 1);
skip = genjmp2(s, OP_JMPNIL, cursp(), 0, val); skip = genjmp2(s, OP_JMPNIL, cursp(), 0, val);
} }
idx = new_sym(s, sym); idx = new_sym(s, sym);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment