From: eregontp@... Date: 2020-11-03T14:47:45+00:00 Subject: [ruby-core:100702] [Ruby master Bug#17305] rb_rescue2() seems to loop forever if given a non-module for rescued exceptions on <= 2.6.6 Issue #17305 has been reported by Eregon (Benoit Daloze). ---------------------------------------- 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 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- Specifically, ```ruby ruby_version_is "2.7" do # seems to hang on CRuby <= 2.6.6 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 end ``` in `spec/ruby/optional/capi/kernel_spec.rb` reproduces the issue. Ruby 2.7.0+ seems fine and raises the expected TypeError. -- https://bugs.ruby-lang.org/ Unsubscribe: