mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert "Make constant assignments more conforming to JIS X 3017:2013 11.4.2.2.3"
This reverts commit 44caca11cf
.
The change caused a build failure.
http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/2102153
This commit is contained in:
parent
11f8c89171
commit
1ff26dc4c7
2 changed files with 8 additions and 21 deletions
21
compile.c
21
compile.c
|
@ -6855,26 +6855,21 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
|
|||
break;
|
||||
}
|
||||
case NODE_CDECL:{
|
||||
ID base_id;
|
||||
CHECK(COMPILE(ret, "lvalue", node->nd_value));
|
||||
|
||||
if (!popped) {
|
||||
ADD_INSN(ret, line, dup);
|
||||
}
|
||||
|
||||
if (node->nd_vid) {
|
||||
ADD_INSN1(ret, line, putspecialobject,
|
||||
INT2FIX(VM_SPECIAL_OBJECT_CONST_BASE));
|
||||
base_id = node->nd_vid;
|
||||
ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_vid));
|
||||
}
|
||||
else {
|
||||
compile_cpath(ret, iseq, node->nd_else);
|
||||
base_id = node->nd_else->nd_mid;
|
||||
ADD_INSN1(ret, line, setconstant, ID2SYM(node->nd_else->nd_mid));
|
||||
}
|
||||
CHECK(COMPILE(ret, "lvalue", node->nd_value));
|
||||
|
||||
if (popped) {
|
||||
ADD_INSN(ret, line, swap);
|
||||
} else {
|
||||
ADD_INSN(ret, line, dup);
|
||||
ADD_INSN1(ret, line, reverse, INT2FIX(3));
|
||||
}
|
||||
|
||||
ADD_INSN1(ret, line, setconstant, ID2SYM(base_id));
|
||||
break;
|
||||
}
|
||||
case NODE_CVASGN:{
|
||||
|
|
|
@ -69,12 +69,4 @@ PRE
|
|||
def test_toplevel_lookup
|
||||
assert_raise(NameError, '[Feature #11547]') {TestConst::Object}
|
||||
end
|
||||
|
||||
def test_evaluation_order
|
||||
assert_raise_with_message(RuntimeError, "recv", 'JIS X 3017:2013 11.4.2.2.3') {
|
||||
eval <<~EOS
|
||||
raise('recv')::C = raise('value')
|
||||
EOS
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue