-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Environment
Initially we found the problem using Jruby 9.2.1.0, but it's also actual in 9.1.7.0 and in the latest version.
- JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [darwin-x86_64]
- Operating system and platform (e.g.
uname -a)
Darwin JBA-MacBook-Pro.local 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct 5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64
Other relevant info you may wish to add:
- Installed or activated gems
N/A - Application/framework version (e.g. Rails, Sinatra)
N/A - Environment variables
N/A
Test code:
def test_match(string)
if string =~ /(.)/
$1
end
end
1000000.times { test_match("a") }
test_match("b")
Expected Behavior
- function
test_matchcall always returns value (as in Ruby MRI or ifmatchis used instead of=~):
jruby-9.2.5.0 :026 > test_match("b")
=> "b"
Actual Behavior
After some iterations returned result always is nil:
jruby-9.2.5.0 :009 > test_match("b")
=> nil
jruby-9.2.5.0 :010 > test_match("b")
=> nil
Full console output:
test_script.log
Reactions are currently unavailable