Project

General

Profile

Actions

Bug #20866

open

Prism assertion when running simplecov with branch coverage and requiring certain code

Added by Earlopain (Earlopain _) 12 days ago. Updated 5 days ago.

Status:
Assigned
Assignee:
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-11-05T13:53:41Z master ed06f018bd) +PRISM [x86_64-linux]
[ruby-core:119735]

Description

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:

# Gemfile
source "https://rubygems.org"

gem "simplecov"
# test.rb
require "bundler"
require "simplecov"

SimpleCov.start do
  enable_coverage :branch
end

require_relative "external"
# external.rb
def perform_completion
  case @completion_state
  when CompletionState::PERFECT_MATCH
    @dig_perfect_match_proc&.(@perfect_matched)
  end
end
$ 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0