diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-19 06:39:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-19 06:39:01 +0000 |
commit | 6ea002a7a28ac11424798f448f1765ccf0513b95 (patch) | |
tree | 53aac200b92c8e121fabd1f1ae65ffb765c015d1 /variable.c | |
parent | 0fc6877ed5e2ef9f81cbbab488acc2f94912e116 (diff) |
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
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |