Issue #11012 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

r49922, r50111 and r50112 (r49922 for resolv conflict) were backported into `ruby_2_2` branch at r50548.

----------------------------------------
Bug #11012: `local_variable_get` crashes on a `Proc` from a method
https://bugs.ruby-lang.org/issues/11012#change-52497

* Author: Nobuyoshi Nakada
* Status: Closed
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v: 50107
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
----------------------------------------
The following code shows unexpected random object, or segfaults sometimes.

~~~ruby
class << (obj = Object.new)
  src = 1000.times.map {|i|"v#{i} = "}.join("")
  eval("def foo()\n""#{src}nil\n""end")
end

b = obj.method(:foo).to_proc.binding
p b.local_variable_get("v999")
~~~



-- 
https://bugs.ruby-lang.org/