From aea14e68fb32af5323a52676f760938794080ba0 Mon Sep 17 00:00:00 2001
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Sat, 10 Feb 2018 16:54:47 +0000
Subject: 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
---
 insns.def | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index fb5e83cc75..2c1f7d3198 100644
--- a/insns.def
+++ b/insns.def
@@ -951,10 +951,13 @@ getinlinecache
 ()
 (VALUE val)
 {
-    val = vm_ic_hit_p(ic, GET_EP());
-    if (val != Qnil) {
+    if (vm_ic_hit_p(ic, GET_EP())) {
+	val = ic->ic_value.value;
 	JUMP(dst);
     }
+    else {
+	val = Qnil;
+    }
 }
 
 /* set inline cache */
-- 
cgit v1.2.3

