
Issue #20159 has been updated by tompng (tomoya ishida). I found that this is because syntax_suggest is using prism. It's not caused by iseq loading, I now think this is not a bug. ``` % (echo "<<A+%"; echo "A") > a.rb % ruby a.rb Assertion failure % ruby --disable-gems a.rb SyntaxError % ruby --disable-gems -r syntax_suggest a.rb Assertion failure ``` ---------------------------------------- Bug #20159: Prism assertion failure even if it is executed with --parser=parse.y https://bugs.ruby-lang.org/issues/20159#change-106104 * Author: tompng (tomoya ishida) * Status: Open * Priority: Normal * Assignee: kddnewton (Kevin Newton) * ruby -v: ruby 3.4.0dev (2024-01-07T16:23:58Z master 8b86d6f0c1) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Prism fails to parse this code with assertion failed. Reported at https://github.com/ruby/prism/issues/1616 ~~~ruby <<A+% A ~~~ Ruby exits with assertion failed even if it's run with option `--parser=parse.y` ~~~ # ruby -v ruby 3.4.0dev (2024-01-07T16:23:58Z master 8b86d6f0c1) [x86_64-linux] # (echo "<<A+%"; echo "A") > a.rb # ruby --parser=parse.y a.rb ruby: prism/util/pm_newline_list.c:42: pm_newline_list_append: Assertion `list->size == 0 || newline_offset > list->offsets[list->size - 1]' failed. qemu: uncaught target signal 6 (Aborted) - core dumped Aborted ~~~ `eval` will correclty result in SyntaxError, `require` and `load` exits with assertion failed. ~~~ruby # irb irb(main):001> eval File.read('a.rb') (irb):1:in `eval': (eval at (irb):1):1: unterminated string meets end of file (SyntaxError) irb(main):002> load 'a.rb' prism/util/pm_newline_list.c:42: pm_newline_list_append: Assertion `list->size == 0 || newline_offset > list->offsets[list->size - 1]' failed. qemu: uncaught target signal 6 (Aborted) - core dumped Aborted ~~~ -- https://bugs.ruby-lang.org/