
Issue #18991 has been updated by usa (Usaku NAKAMURA). Backport changed from 3.0: UNKNOWN, 3.1: REQUIRED, 3.2: DONTNEED to 3.0: UNKNOWN, 3.1: DONE, 3.2: DONTNEED ruby_3_1 d494cf4ddababb80660381e963f910ccacc3f7bc merged revision(s) 4a7d6c2852aa734506be83c932168e8f974687b5. ---------------------------------------- Bug #18991: False LocalJumpError when branch coverage is enabled https://bugs.ruby-lang.org/issues/18991#change-105178 * 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: 3.0: UNKNOWN, 3.1: DONE, 3.2: DONTNEED ---------------------------------------- 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/