summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-26 03:37:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-26 03:37:08 +0000
commitb6cf78511962ba901ca4a86ffdeb6624afe8dfb1 (patch)
tree071d70ddc6aa9d9f0911118f5f2eccd9155f8a92
parent1af43ae867807010d1fc37b440cbc79215de34b9 (diff)
* vm.c (collect_local_variables_in_env): skips internal variables.
[ruby-core:25125] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--bootstraptest/test_eval.rb11
-rw-r--r--vm.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a256e5693..721d6b60d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Aug 26 12:36:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm.c (collect_local_variables_in_env): skips internal variables.
+ [ruby-core:25125]
+
Tue Aug 25 23:51:07 2009 NARUSE, Yui <naruse@ruby-lang.org>
* tool/enc-unicode.rb: added for generate name2ctype.kwd.
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index 6dc23468cb..452ce43107 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -297,5 +297,14 @@ assert_equal "(eval):1:in `block in <main>': ", %q{
rescue => e
e.message
end
-}, ' [ruby-dev:35392]'
+}, '[ruby-dev:35392]'
+assert_equal "[:x]", %q{
+ def kaboom!
+ yield.eval("local_variables")
+ end
+
+ for x in enum_for(:kaboom!)
+ binding
+ end
+}, '[ruby-core:25125]'
diff --git a/vm.c b/vm.c
index 36a9776864..c9c10dccbe 100644
--- a/vm.c
+++ b/vm.c
@@ -382,7 +382,7 @@ collect_local_variables_in_env(rb_env_t * const env, const VALUE ary)
int i;
for (i = 0; i < env->block.iseq->local_table_size; i++) {
ID lid = env->block.iseq->local_table[i];
- if (lid) {
+ if (rb_is_local_id(lid)) {
rb_ary_push(ary, ID2SYM(lid));
}
}