Do not cache non-"once" dregexp by headius · Pull Request #6996 · jruby/jruby (original) (raw)
The cache here serves as a cache for dynamic "once" regexps but
is also being used as the holder for non-"once" regexp. This leads
to a concurrency issue since a single field in this instruction is
used across threads and they may step on each other.
This patch avoids using the shared field for non-"once" dynamic
regexps. As a side effect, these instruction instances will not
be queriable for their last-built RubyRegexp, which also seems
appropriate if they are not a "once" dregexp.
Fixes #6992