[ruby-core:112652] [Ruby master Bug#19471] Regexp::compile does not handle :timeout argument

Issue #19471 has been reported by os (Shigeki OHARA). ---------------------------------------- Bug #19471: Regexp::compile does not handle :timeout argument https://bugs.ruby-lang.org/issues/19471 * Author: os (Shigeki OHARA) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-freebsd13.1] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- I think Regexp::compile is just an alias for Regexp::new, so I assume it handles the :timeout argument. However, Regexp::compile does not seem to handle the :timeout argument properly. ``` $ irb irb(main):001:0> RUBY_VERSION => "3.2.1" irb(main):002:0> re_new = Regexp.new('hoge', timeout: 1.0) => /hoge/ irb(main):003:0> re_new.timeout => 1.0 irb(main):004:0> re_compile = Regexp.compile('hoge', timeout: 1.0) => /hoge/i irb(main):005:0> re_compile.timeout => nil irb(main):006:0> ``` -- https://bugs.ruby-lang.org/

Issue #19471 has been updated by naruse (Yui NARUSE). Backport changed from 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE ruby_3_2 fb4ffce0dd8cae3b7d0141d3b1ea3f0ab710a45a merged revision(s) 680bd9027f8cb7977bbc216609db2f4e3cf199a8. ---------------------------------------- Bug #19471: Regexp::compile does not handle :timeout argument https://bugs.ruby-lang.org/issues/19471#change-102565 * Author: os (Shigeki OHARA) * Status: Closed * Priority: Normal * ruby -v: ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-freebsd13.1] * Backport: 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE ---------------------------------------- I think Regexp::compile is just an alias for Regexp::new, so I assume it handles the :timeout argument. However, Regexp::compile does not seem to handle the :timeout argument properly. ``` $ irb irb(main):001:0> RUBY_VERSION => "3.2.1" irb(main):002:0> re_new = Regexp.new('hoge', timeout: 1.0) => /hoge/ irb(main):003:0> re_new.timeout => 1.0 irb(main):004:0> re_compile = Regexp.compile('hoge', timeout: 1.0) => /hoge/i irb(main):005:0> re_compile.timeout => nil irb(main):006:0> ``` -- https://bugs.ruby-lang.org/
participants (2)
-
naruse (Yui NARUSE)
-
os (Shigeki OHARA)