diff options
| author | NARUSE, Yui <naruse@airemix.jp> | 2024-01-30 20:29:02 +0900 |
|---|---|---|
| committer | NARUSE, Yui <naruse@airemix.jp> | 2024-01-30 20:29:02 +0900 |
| commit | f585171a6b1d6c20b3c162fd59dc874510ed2a49 (patch) | |
| tree | 3024caed094a7d7439aed211fc538181720d5a3f /tool | |
| parent | f8f0d342e48a38caac6d32b438c145bb581a51e6 (diff) | |
merge revision(s) e12d4c654e3cb7a4473014610bc3bae41aaf811e: [Backport #20104]
Don't create T_MATCH object if /regexp/.match(string) doesn't match
Fixes [Bug #20104]
---
re.c | 9 ++++++---
test/ruby/test_regexp.rb | 12 ++++++++++++
tool/lib/envutil.rb | 8 ++++++++
3 files changed, 26 insertions(+), 3 deletions(-)
Diffstat (limited to 'tool')
| -rw-r--r-- | tool/lib/envutil.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tool/lib/envutil.rb b/tool/lib/envutil.rb index 9be0aac479..309a6af40f 100644 --- a/tool/lib/envutil.rb +++ b/tool/lib/envutil.rb @@ -254,6 +254,14 @@ module EnvUtil end module_function :under_gc_compact_stress + def without_gc + prev_disabled = GC.disable + yield + ensure + GC.enable unless prev_disabled + end + module_function :without_gc + def with_default_external(enc) suppress_warning { Encoding.default_external = enc } yield |
