summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-10 16:54:47 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-10 16:54:47 (GMT)
commitaea14e68fb32af5323a52676f760938794080ba0 (patch)
treeba3749046e859a91710c9d1ae584e96c9659a30a /vm_insnhelper.c
parent7b6f0478e3f2606583b61c2ccb8f3ddebc93f4bb (diff)
insns.def: cache nil const
* insns.def (getinlinecache): Qnil is a valid value as a constant. this can be observable when accessing a deprecated constant which is nil. non-nil constant is warned just once for each location, but every time if it is nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index c14f05e..a0f63df 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3265,16 +3265,13 @@ vm_opt_newarray_min(rb_num_t num, const VALUE *ptr)
#undef id_cmp
-static VALUE
+static int
vm_ic_hit_p(IC ic, const VALUE *reg_ep)
{
- if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE() &&
- (ic->ic_cref == NULL || ic->ic_cref == rb_vm_get_cref(reg_ep))) {
- return ic->ic_value.value;
- }
- else {
- return Qnil;
+ if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE()) {
+ return (ic->ic_cref == NULL || ic->ic_cref == rb_vm_get_cref(reg_ep));
}
+ return FALSE;
}
static void