mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
568a5f646b
commit
350c2ac453
1 changed files with 7 additions and 9 deletions
|
@ -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))) {
|
if (LIKELY(index < ROBJECT_NUMIV(obj))) {
|
||||||
val = ROBJECT_IVPTR(obj)[index];
|
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 {
|
else {
|
||||||
st_data_t index;
|
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 {
|
else {
|
||||||
RB_DEBUG_COUNTER_INC(ivar_get_ic_miss_noobject);
|
RB_DEBUG_COUNTER_INC(ivar_get_ic_miss_noobject);
|
||||||
|
|
Loading…
Add table
Reference in a new issue