Bug #9063
closedirb crashes when #backtrace of raised Exception is nil
Description
=begin
See also the pull req on GitHub: https://github.com/ruby/ruby/pull/434
When an exception whose backtrace is nil is raised, irb crashes and exits with the following backtrace:
irb> class E < Exception; def backtrace; nil; end; end
irb> raise E
E: E
/Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb.rb:502:in block (2 levels) in eval_input': undefined method
[]' for nil:NilClass (NoMethodError)
from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb.rb:624:in signal_status' from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb.rb:489:in
block in eval_input'
from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb/ruby-lex.rb:247:in block (2 levels) in each_top_level_statement' from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb/ruby-lex.rb:233:in
loop'
from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb/ruby-lex.rb:233:in block in each_top_level_statement' from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb/ruby-lex.rb:232:in
catch'
from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb/ruby-lex.rb:232:in each_top_level_statement' from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb.rb:488:in
eval_input'
from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb.rb:397:in block in start' from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb.rb:396:in
catch'
from /Users/makimoto/.rbenv/versions/trunk/lib/ruby/2.1.0/irb.rb:396:in start' from /Users/makimoto/.rbenv/versions/trunk/bin/irb:11:in
'
=end
Files