Backport #2519

__method__ can return NULL (and therefore crash ruby)

Added by Marc-Andre Lafortune about 2 years ago. Updated 10 months ago.

[ruby-core:27296]
Status:Closed Start date:12/23/2009
Priority:High Due date:
Assignee:Shyouhei Urabe % Done:

100%

Category:-
Target version:-

Description

In Ruby 1.8.7 and latest 1.8.8:

$ cat ohoh.rb 
puts __method__

$ ruby18dev -e "load 'ohoh.rb'"
val (null) id 140734799802560/Users/work/test/ohoh.rb:1:in `to_s': NULL pointer given (ArgumentError)
	from /Users/work/test/ohoh.rb:1:in `puts'
	from /Users/work/test/ohoh.rb:1
	from -e:1:in `load'
	from -e:1


Doing __method__.inspect instead will crash Ruby

Associated revisions

Revision 26159
Added by nobu about 2 years ago

* eval.c (rb_load): initialize orig_func. [ruby-core:27296]

Revision 28246
Added by shyouhei over 1 year ago

merge revision(s) 26159: * eval.c (rb_load): initialize orig_func. [ruby-core:27296]

History

Updated by Nobuyoshi Nakada about 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
This issue was solved with changeset r26159.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

Updated by Shyouhei Urabe almost 2 years ago

  • Status changed from Closed to Assigned
  • Assignee set to Shyouhei Urabe

Updated by Shyouhei Urabe over 1 year ago

  • Status changed from Assigned to Closed
This issue was solved with changeset r28246.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

Also available in: Atom PDF