Issue #8345 has been updated by charliesome (Charlie Somerville).


The same happens with Proc#curry too:

=begin
def proc
end

->{}.curry
=end
----------------------------------------
Bug #8345: Method#to_proc assumes lambda returns a Proc
https://bugs.ruby-lang.org/issues/8345#change-39035

Author: charliesome (Charlie Somerville)
Status: Open
Priority: Normal
Assignee: charliesome (Charlie Somerville)
Category: 
Target version: 
ruby -v: ruby 2.1.0dev (2013-04-29 trunk 40512) [x86_64-darwin11.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


=begin
Method#to_proc calls #lambda and assumes the return value is a Proc by passing it to GetProcPtr.

If #lambda is overridden this can cause segfaults:

    def lambda
    end

    method(:puts).to_proc # segfault
=end


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