A RegExp has a YarrCodeBlock that has 4 MacroAssemblerCodeRefs for compiled code. If one of these compilations succeeds, RegExp::m_state will be set to JITCode. Subsequently, if RegExp tries to compile another one of these but fails, m_state will be left untouched i.e. it still says JITCode. As a result, when RegExp::match() later tries to execute the non-existant compiled code, it will crash. The fix is to downgrade m_state to ByteCode if RegExp ever fails to compile. This failure should be rare. We'll do the minimal work here to fix the issue and keep an eye on the perf bots. If perf regresses, we can do some optimization work then.
<rdar://problem/21764196>
Created attachment 256937 [details] the fix.
Comment on attachment 256937 [details] the fix. r=me
I've run the jsc and layout tests and did not see any regressions. Landed in r186920: <http://trac.webkit.org/r186920>.