[ruby-core:115173] [Ruby master Bug#18991] False LocalJumpError when branch coverage is enabled

Issue #18991 has been updated by kjtsanaktsidis (KJ Tsanaktsidis). Thank you for the fix mame! Would it be possible for this to be backported to the 3.1 branch? The fix seems to apply cleanly and resolves our issue. I opened a backport PR here: https://github.com/ruby/ruby/pull/8768. ---------------------------------------- Bug #18991: False LocalJumpError when branch coverage is enabled https://bugs.ruby-lang.org/issues/18991#change-105084 * Author: qnighy (Masaki Hara) * Status: Closed * Priority: Normal * Assignee: mame (Yusuke Endoh) * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Enabling branch coverage leads to a false LocalJumpError where it should not be raised. ```ruby # test.rb require "coverage" Coverage.start(branches: true) # Coverage.start(lines: true) load "./test2.rb" ``` ```ruby # test2.rb 1&.tap do break end ``` Output: ``` $ ruby test.rb /Users/qnighy/workdir/branch-coverage-bug/test2.rb:1:in `block in <top (required)>': break from proc-closure (LocalJumpError) from <internal:kernel>:90:in `tap' from /Users/qnighy/workdir/branch-coverage-bug/test2.rb:1:in `<top (required)>' from test.rb:5:in `load' from test.rb:5:in `<main>' ``` -- https://bugs.ruby-lang.org/
participants (1)
-
kjtsanaktsidis (KJ Tsanaktsidis)