Bug #2120: Kernel.eval("local_variables", binding) in for SEGV in 1.9.1
http://redmine.ruby-lang.org/issues/show/2120

Author: ujihisa .
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.1p281 (2009-08-09 revision 24476) [i386-darwin9.7.0]

Howard Yeh showed that the following code causes SEGV in [ruby-core:25634] in ruby 1.9.1 (not in 1.9.2dev):

for i in 1..100
 a = 1
 p Kernel.eval("local_variables",binding)
 break
end

The minimum bug reproduction code is

for i in [1]
  p eval('local_variables', binding)
end


The attached patch solves this problem.


----------------------------------------
http://redmine.ruby-lang.org