diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-06-16 23:00:05 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-06-16 23:00:05 +0900 |
commit | 1ff26dc4c706cd6e8f227d159a2b23cba5f6de77 (patch) | |
tree | a214d8e8730d08e3fd6f9ff9109a9abc0686fc52 /compile.c | |
parent | 11f8c89171ff0b260891dec064cf69d9400a0704 (diff) | |
download | ruby-1ff26dc4c706cd6e8f227d159a2b23cba5f6de77.tar.gz |
Revert "Make constant assignments more conforming to JIS X 3017:2013 11.4.2.2.3"
This reverts commit 44caca11cfa6bea01a1ef738846183f1a56d5658.
The change caused a build failure.
http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/2102153
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -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:{ |