summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 13:51:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-12 13:51:12 +0000
commitc9a1f7a42beebdd42c88fb427b6ca4ea6d5df89f (patch)
tree0c18127fc15a74dbef1bb2b4992e850d1a63d5a5 /compile.c
parentc0764a3cd89ec5c81d2f0163228b3ab2b3fb708a (diff)
compile.c: compile_const_prefix
* compile.c (compile_const_prefix): rename, and check the result of parts of the prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/compile.c b/compile.c
index 0fa605a682..1cd21d82ca 100644
--- a/compile.c
+++ b/compile.c
@@ -3466,23 +3466,23 @@ compile_massign(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popped)
}
static int
-compile_colon2(rb_iseq_t *iseq, NODE *node,
- LINK_ANCHOR *const pref, LINK_ANCHOR *const body)
+compile_const_prefix(rb_iseq_t *iseq, NODE *node,
+ LINK_ANCHOR *const pref, LINK_ANCHOR *const body)
{
switch (nd_type(node)) {
case NODE_CONST:
- debugi("compile_colon2 - colon", node->nd_vid);
+ debugi("compile_const_prefix - colon", node->nd_vid);
ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_vid));
break;
case NODE_COLON3:
- debugi("compile_colon2 - colon3", node->nd_mid);
+ debugi("compile_const_prefix - colon3", node->nd_mid);
ADD_INSN(body, nd_line(node), pop);
ADD_INSN1(body, nd_line(node), putobject, rb_cObject);
ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
break;
case NODE_COLON2:
- compile_colon2(iseq, node->nd_head, pref, body);
- debugi("compile_colon2 - colon2", node->nd_mid);
+ CHECK(compile_const_prefix(iseq, node->nd_head, pref, body));
+ debugi("compile_const_prefix - colon2", node->nd_mid);
ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
break;
default:
@@ -6019,7 +6019,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
INIT_ANCHOR(pref);
INIT_ANCHOR(body);
- compile_colon2(iseq, node, pref, body);
+ CHECK(compile_const_prefix(iseq, node, pref, body));
if (LIST_SIZE_ZERO(pref)) {
if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));