[ruby-core:119735] [Ruby master Bug#20866] Prism assertion when running simplecov with branch coverage and requiring certain code

Issue #20866 has been reported by Earlopain (A S). ---------------------------------------- Bug #20866: Prism assertion when running simplecov with branch coverage and requiring certain code https://bugs.ruby-lang.org/issues/20866 * Author: Earlopain (A S) * Status: Open * ruby -v: ruby 3.4.0dev (2024-11-05T13:53:41Z master ed06f018bd) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I stumbled upon the following bug report against simplecov: https://github.com/simplecov-ruby/simplecov/issues/1113 I reduced the error down to the following: ```rb # Gemfile source "https://rubygems.org" gem "simplecov" ``` ```rb # test.rb require "bundler" require "simplecov" SimpleCov.start do enable_coverage :branch end require_relative "external" ``` ```rb # external.rb def perform_completion case @completion_state when CompletionState::PERFECT_MATCH @dig_perfect_match_proc&.(@perfect_matched) end end ``` ```sh $ bundle exec ruby test.rb ruby: prism/util/pm_newline_list.c:93: pm_newline_list_line_column: Assertion `cursor >= list->start' failed. Aborted (core dumped) ``` When running with `parse.y` the error doesn't occur. -- https://bugs.ruby-lang.org/

Issue #20866 has been updated by alanwu (Alan Wu). Assignee set to prism ---------------------------------------- Bug #20866: Prism assertion when running simplecov with branch coverage and requiring certain code https://bugs.ruby-lang.org/issues/20866#change-110405 * Author: Earlopain (A S) * Status: Open * Assignee: prism * ruby -v: ruby 3.4.0dev (2024-11-05T13:53:41Z master ed06f018bd) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I stumbled upon the following bug report against simplecov: https://github.com/simplecov-ruby/simplecov/issues/1113 I reduced the error down to the following: ```rb # Gemfile source "https://rubygems.org" gem "simplecov" ``` ```rb # test.rb require "bundler" require "simplecov" SimpleCov.start do enable_coverage :branch end require_relative "external" ``` ```rb # external.rb def perform_completion case @completion_state when CompletionState::PERFECT_MATCH @dig_perfect_match_proc&.(@perfect_matched) end end ``` ```sh $ bundle exec ruby test.rb ruby: prism/util/pm_newline_list.c:93: pm_newline_list_line_column: Assertion `cursor >= list->start' failed. Aborted (core dumped) ``` When running with `parse.y` the error doesn't occur. -- https://bugs.ruby-lang.org/

Issue #20866 has been updated by eightbitraptor (Matt V-H). This was caused by an issue with how the prism compiler tracks the ending location of call nodes of the form `a&.()`. Should be fixed by [this PR](https://github.com/ruby/ruby/pull/12130) ---------------------------------------- Bug #20866: Prism assertion when running simplecov with branch coverage and requiring certain code https://bugs.ruby-lang.org/issues/20866#change-110717 * Author: Earlopain (Earlopain _) * Status: Assigned * Assignee: prism * ruby -v: ruby 3.4.0dev (2024-11-05T13:53:41Z master ed06f018bd) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I stumbled upon the following bug report against simplecov: https://github.com/simplecov-ruby/simplecov/issues/1113 I reduced the error down to the following: ```rb # Gemfile source "https://rubygems.org" gem "simplecov" ``` ```rb # test.rb require "bundler" require "simplecov" SimpleCov.start do enable_coverage :branch end require_relative "external" ``` ```rb # external.rb def perform_completion case @completion_state when CompletionState::PERFECT_MATCH @dig_perfect_match_proc&.(@perfect_matched) end end ``` ```sh $ bundle exec ruby test.rb ruby: prism/util/pm_newline_list.c:93: pm_newline_list_line_column: Assertion `cursor >= list->start' failed. Aborted (core dumped) ``` When running with `parse.y` the error doesn't occur. -- https://bugs.ruby-lang.org/
participants (3)
-
alanwu (Alan Wu)
-
Earlopain (A S)
-
eightbitraptor (Matt V-H)