From b16e5cd6337cb68c1ae5c8a47fac251ec9940096 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 19 Jul 2016 06:39:01 +0000 Subject: variable.c: exclude private constants * variable.c (rb_local_constants_i): exclude private constants when excluding inherited constants too. [Bug #12345] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 4d3222b5db..0966685690 100644 --- a/variable.c +++ b/variable.c @@ -2399,7 +2399,7 @@ sv_i(ID key, VALUE v, void *a) static enum rb_id_table_iterator_result rb_local_constants_i(ID const_name, VALUE const_value, void *ary) { - if (rb_is_const_id(const_name)) { + if (rb_is_const_id(const_name) && !RB_CONST_PRIVATE_P((rb_const_entry_t *)const_value)) { rb_ary_push((VALUE)ary, ID2SYM(const_name)); } return ID_TABLE_CONTINUE; -- cgit v1.2.3