Actions
Bug #19173
closedsyntax_suggest segfaults on syntax error when refinement activated
Description
While reporting certain syntax errors (e.g. “Invalid yield”, “Invalid redo”), syntax_suggest
segfaults when a refinement is activated:
% echo 'yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)
% echo 'using Module.new; yield' > test.rb; ruby test.rb
test.rb:1: Invalid yield
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/fileutils.rb:2646: [BUG] Segmentation fault at 0x0000000000000008
[…]
-- Ruby level backtrace information ----------------------------------------
/Users/tom/.rubies/ruby-master/lib/ruby/3.2.0+3/syntax_suggest/core_ext.rb:25:in `detailed_message'
There’s no problem if syntax_suggest
is disabled:
% echo 'using Module.new; yield' > test.rb; ruby --disable-syntax_suggest test.rb
test.rb:1: Invalid yield
test.rb: compile error (SyntaxError)
This bug exists on both 3.2.0-preview3
and master
, and I’ve verified it on x86_64 as well as my arm64 machine. A crash report log is attached.
Files
Actions
Like0
Like0Like0Like0Like0Like0