From ac112f2b5dc7e16ccde8f048be80946187a033b0 Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Wed, 6 Nov 2019 01:47:32 -0500 Subject: Avoid top-level search for nested constant reference from nil in defined? Fixes [Bug #16332] Constant access was changed to no longer allow top-level constant access through `nil`, but `defined?` wasn't changed at the same time to stay consistent. Use a separate defined type to distinguish between a constant referenced from the current lexical scope and one referenced from another namespace. --- iseq.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'iseq.h') diff --git a/iseq.h b/iseq.h index c9cc12529b..1fcf7cb210 100644 --- a/iseq.h +++ b/iseq.h @@ -300,7 +300,8 @@ enum defined_type { DEFINED_EXPR, DEFINED_IVAR2, DEFINED_REF, - DEFINED_FUNC + DEFINED_FUNC, + DEFINED_CONST_FROM }; VALUE rb_iseq_defined_string(enum defined_type type); -- cgit v1.2.3