summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-07 02:25:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-07 02:25:43 +0000
commit11eb87013653ba6d2321ecf4db07fb052fe19a98 (patch)
tree50e25af0b8ca68222fd4af9e73779720b67e7b08 /vm.c
parentc8dbc43de6003e6d97bd5d7043598a481c4fa694 (diff)
vm_eval.c: exclude hidden variables
* vm_eval.c (rb_f_local_variables): exclude variables hidden by shadowing. [ruby-core:60501] [Bug #9486] * vm.c (collect_local_variables_in_iseq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index af5bcb2..4d41575 100644
--- a/vm.c
+++ b/vm.c
@@ -523,7 +523,7 @@ collect_local_variables_in_iseq(rb_iseq_t *iseq, const VALUE vars)
for (i = 0; i < iseq->local_table_size; i++) {
ID lid = iseq->local_table[i];
if (rb_is_local_id(lid)) {
- rb_ary_push(vars, ID2SYM(lid));
+ rb_hash_aset(vars, ID2SYM(lid), Qtrue);
}
}
return 1;