mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
revert r61371 for [Bug #14214]
Reverted patch doesn't check overwritten value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
168c019998
commit
85277d5be0
1 changed files with 3 additions and 21 deletions
24
compile.c
24
compile.c
|
@ -3366,21 +3366,6 @@ compile_flip_flop(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const nod
|
||||||
return COMPILE_OK;
|
return COMPILE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
local_block_param_p(rb_iseq_t *iseq, ID vid)
|
|
||||||
{
|
|
||||||
int idx = iseq->body->local_iseq->body->local_table_size - get_local_var_idx(iseq, vid);
|
|
||||||
int level = get_lvar_level(iseq);
|
|
||||||
return iseq_local_block_param_p(iseq, idx, level);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
compile_defined_yield(rb_iseq_t *iseq, LINK_ANCHOR *const ret, int line, VALUE needstr)
|
|
||||||
{
|
|
||||||
ADD_INSN(ret, line, putnil);
|
|
||||||
ADD_INSN3(ret, line, defined, INT2FIX(DEFINED_YIELD), 0, needstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *cond,
|
compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *cond,
|
||||||
LABEL *then_label, LABEL *else_label)
|
LABEL *then_label, LABEL *else_label)
|
||||||
|
@ -3429,11 +3414,6 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *co
|
||||||
case NODE_DEFINED:
|
case NODE_DEFINED:
|
||||||
CHECK(compile_defined_expr(iseq, ret, cond, Qfalse));
|
CHECK(compile_defined_expr(iseq, ret, cond, Qfalse));
|
||||||
goto branch;
|
goto branch;
|
||||||
case NODE_LVAR:
|
|
||||||
if (local_block_param_p(iseq, cond->nd_vid)) {
|
|
||||||
compile_defined_yield(iseq, ret, nd_line(cond), Qfalse);
|
|
||||||
goto branch;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
CHECK(COMPILE(ret, "branch condition", cond));
|
CHECK(COMPILE(ret, "branch condition", cond));
|
||||||
branch:
|
branch:
|
||||||
|
@ -4170,7 +4150,9 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
|
||||||
}
|
}
|
||||||
|
|
||||||
case NODE_YIELD:
|
case NODE_YIELD:
|
||||||
compile_defined_yield(iseq, ret, nd_line(node), needstr);
|
ADD_INSN(ret, nd_line(node), putnil);
|
||||||
|
ADD_INSN3(ret, nd_line(node), defined, INT2FIX(DEFINED_YIELD), 0,
|
||||||
|
needstr);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case NODE_BACK_REF:
|
case NODE_BACK_REF:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue