summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-19 06:39:01 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-19 06:39:01 (GMT)
commit6ea002a7a28ac11424798f448f1765ccf0513b95 (patch)
tree53aac200b92c8e121fabd1f1ae65ffb765c015d1 /variable.c
parent0fc6877ed5e2ef9f81cbbab488acc2f94912e116 (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index 4d3222b..0966685 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;