RESOLVED FIXED 241107
ASSERTION FAILED: regExp->isValid() LLIntSlowPaths.cpp(625)
https://bugs.webkit.org/show_bug.cgi?id=241107
Summary ASSERTION FAILED: regExp->isValid() LLIntSlowPaths.cpp(625)
Michael Saboff
Reported 2022-05-30 11:31:05 PDT
If there is an error when parsing a regular expression, we don't emit a NewRegExp bytecode. Instead we create a syntax error. The case here is that the regexp parses fine, but fails when we try to generate JIT code or try to compile to YARR bytecode. Although this code generation fails, we cache the RegExp. On subsequent use of the same RegExp, we retrieve the cached RegExp and assert that it is "valid". This validity test is not necessary as the matching code properly handles the case where we can't generate code for a RegExp and turns it into a ParseError. Therefore we can remove these debug asserts of a valid RegExp when retrieving from the cache.
Attachments
Michael Saboff
Comment 1 2022-05-30 11:31:19 PDT
Michael Saboff
Comment 2 2022-05-30 12:00:43 PDT
Here is a test case: function testRegExp() { /((a{100000000})*b{2100000000})+/.test("b"); } function test(testRE) { for (let i = 0; i < 5000; ++i) { try { testRE(); } catch {}; } } test(testRegExp);
Michael Saboff
Comment 3 2022-05-30 12:19:52 PDT
EWS
Comment 4 2022-05-31 14:23:39 PDT
Committed r295066 (251161@main): <https://commits.webkit.org/251161@main> Reviewed commits have been landed. Closing PR #1163 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.