Project

General

Profile

Bug #16453

irb crashes when using array literal and heredoc

Added by jnchito (Junichi Ito) about 2 months ago. Updated 5 days ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
[ruby-core:<unknown>]
Tags:

Description

I wanted to type like this:

[<<FOO]
hello
FOO

But IRB crashed after input "hello" (and return):

irb(main):001:-" [<<FOO]
irb(main):002:-" helloTraceback (most recent call last):
    32: from /Users/jnito/.rbenv/versions/2.7.0/bin/irb:23:in `<main>'
    31: from /Users/jnito/.rbenv/versions/2.7.0/bin/irb:23:in `load'
    30: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
    29: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:398:in `start'
    28: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:469:in `run'
    27: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:469:in `catch'
    26: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:470:in `block in run'
    25: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:535:in `eval_input'
    24: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:134:in `each_top_level_statement'
    23: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:134:in `catch'
    22: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:135:in `block in each_top_level_statement'
    21: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:135:in `loop'
    20: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:138:in `block (2 levels) in each_top_level_statement'
    19: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb/ruby-lex.rb:166:in `lex'
    18: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:516:in `block in eval_input'
    17: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:693:in `signal_status'
    16: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb.rb:517:in `block (2 levels) in eval_input'
    15: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/irb/input-method.rb:258:in `gets'
    14: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
    13: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
    12: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:170:in `readmultiline'
    11: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:232:in `inner_readline'
    10: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:232:in `loop'
     9: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:233:in `block in inner_readline'
     8: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:262:in `read_io'
     7: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:262:in `loop'
     6: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:303:in `block in read_io'
     5: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:234:in `block (2 levels) in inner_readline'
     4: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:234:in `each'
     3: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline.rb:235:in `block (3 levels) in inner_readline'
     2: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline/line_editor.rb:835:in `input_key'
     1: from /Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline/line_editor.rb:855:in `process_auto_indent'
/Users/jnito/.rbenv/versions/2.7.0/lib/ruby/2.7.0/reline/line_editor.rb:855:in `*': negative argument (ArgumentError)

Updated by hsbt (Hiroshi SHIBATA) 6 days ago

  • Assignee set to aycabta (aycabta .)
  • Status changed from Open to Assigned

Updated by aycabta (aycabta .) 5 days ago

  • Status changed from Assigned to Closed

This is already fixed.

Also available in: Atom PDF