From: "mugikurash (Shuta Mugikura) via ruby-core" Date: 2026-08-28T14:14:50+00:00 Subject: [ruby-core:126540] [Ruby Bug#22018] ISeq created via `RubyVM::InstructionSequence.compile` don't support coverage Issue #22018 has been updated by mugikurash (Shuta Mugikura). I found an unintended interaction with `Coverage.line_stub` after this change: calling `line_stub` while coverage is running can reset already-collected coverage counters. I opened #22269 for this issue: https://bugs.ruby-lang.org/issues/22269 Just linking it here since it is related to this change. ---------------------------------------- Bug #22018: ISeq created via `RubyVM::InstructionSequence.compile` don't support coverage https://bugs.ruby-lang.org/issues/22018#change-118723 * Author: byroot (Jean Boussier) * Status: Closed * Backport: 3.3: WONTFIX, 3.4: DONE, 4.0: DONE ---------------------------------------- Reproduction: ```ruby require "coverage" File.write("/tmp/a.rb", <<~RUBY) module CoverableRaw def self.call "cover up" end end CoverableRaw.call RUBY Coverage.start require "/tmp/a.rb" p Coverage.result File.write("/tmp/b.rb", <<~RUBY) module Coverable def self.call "cover up" end end Coverable.call RUBY class RubyVM::InstructionSequence def self.load_iseq(path) compile_file(path) end end Coverage.start require "/tmp/b.rb" p Coverage.result ``` Expected: ```ruby {"/tmp/a.rb" => [1, 1, 1, nil, nil, nil, 1]} {"/tmp/b.rb" => [1, 1, 1, nil, nil, nil, 1]} ``` Actual: ```ruby {"/tmp/a.rb" => [1, 1, 1, nil, nil, nil, 1]} {} ``` Patch: https://github.com/ruby/ruby/pull/16805 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/