Issue #17305 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.5: DONTNEED, 2.6: REQUIRED, 2.7: DONTNEED to 2.5: DONTNEED, 2.6: DONE, 2.7: DONTNEED

merged the patch into ruby_2_6 at r67922

----------------------------------------
Bug #17305: rb_rescue2() seems to loop forever if given a non-module for rescued exceptions on <= 2.6.6
https://bugs.ruby-lang.org/issues/17305#change-91296

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* Backport: 2.5: DONTNEED, 2.6: DONE, 2.7: DONTNEED
----------------------------------------
Specifically,
```ruby
      it "raises TypeError if one of the passed exceptions is not a Module" do
        -> {
          @s.rb_rescue2(-> *_ { raise RuntimeError, "foo" }, :no_exc, -> x { x }, :exc, Object.new, 42)
        }.should raise_error(TypeError, /class or module required/)
      end
```
in
`spec/ruby/optional/capi/kernel_spec.rb`
reproduces the issue.

Ruby 2.7.0+ seems fine and raises the expected TypeError.

---Files--------------------------------
0001-Fix-rb_rescue2-when-called-with-non-module.patch (3.76 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>