diff options
author | Luke Gruber <luke.gru@gmail.com> | 2023-12-30 13:26:59 -0500 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2024-01-01 13:28:26 -0800 |
commit | e12d4c654e3cb7a4473014610bc3bae41aaf811e (patch) | |
tree | 3184f19e8898ca9af24dd5d6ee22afad83fa0530 /tool/lib | |
parent | 676748abcad62c021fc122d137f177d3c0f0f7a8 (diff) |
Don't create T_MATCH object if /regexp/.match(string) doesn't match
Fixes [Bug #20104]
Diffstat (limited to 'tool/lib')
-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 |