summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-19 03:59:13 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-19 03:59:13 (GMT)
commit350c2ac453eff853c6a084d355ddc86fcddbfb20 (patch)
tree80a963dbdc5efdf0a3973338d48a18ed149dd012 /vm_insnhelper.c
parent568a5f646bbf2df2d7a7259d848629792955ecdd (diff)
avoid goto
gcc -Wjump-misses-init warns this goto. That is a false alert. However why on earth do we need to use goto here? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 64ac539..7480815 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -940,14 +940,6 @@ vm_getivar(VALUE obj, ID id, IC ic, struct rb_call_cache *cc, int is_attr)
if (LIKELY(index < ROBJECT_NUMIV(obj))) {
val = ROBJECT_IVPTR(obj)[index];
}
- undef_check:
- if (UNLIKELY(val == Qundef)) {
- if (!is_attr && RTEST(ruby_verbose))
- rb_warning("instance variable %"PRIsVALUE" not initialized", QUOTE_ID(id));
- val = Qnil;
- }
- RB_DEBUG_COUNTER_INC(ivar_get_ic_hit);
- return val;
}
else {
st_data_t index;
@@ -967,8 +959,14 @@ vm_getivar(VALUE obj, ID id, IC ic, struct rb_call_cache *cc, int is_attr)
}
}
}
- goto undef_check;
}
+ if (UNLIKELY(val == Qundef)) {
+ if (!is_attr && RTEST(ruby_verbose))
+ rb_warning("instance variable %"PRIsVALUE" not initialized", QUOTE_ID(id));
+ val = Qnil;
+ }
+ RB_DEBUG_COUNTER_INC(ivar_get_ic_hit);
+ return val;
}
else {
RB_DEBUG_COUNTER_INC(ivar_get_ic_miss_noobject);