Repository navigation
Commit 630d6be
committed
[YARR] EOL string list optimization produces incorrect matches with multiline flag
https://bugs.webkit.org/show_bug.cgi?id=318333
Reviewed by Yusuke Suzuki.
When the multiline flag is set, the EOL string list optimization produces
incorrect matches:
/^(?:a|a\nx)$/m.exec("a\nx") // actual(JIT): "a\nx", expected: "a"
/^(?:a\nb|a)$/m.exec("a\nbQ") // actual(JIT): null, expected: "a"
This patch fixes the bug by disabling the optimization when the multiline
flag is set.
Test: JSTests/stress/regexp-stringlist-eol-multiline.js
* JSTests/stress/regexp-stringlist-eol-multiline.js: Added.
(shouldBe):
* Source/JavaScriptCore/yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::checkForTerminalParentheses):
Canonical link: https://commits.webkit.org/316345@main1 parent f23ffb5 commit 630d6be
2 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2084 | 2084 | | |
2085 | 2085 | | |
2086 | 2086 | | |
2087 | | - | |
| 2087 | + | |
2088 | 2088 | | |
2089 | 2089 | | |
2090 | 2090 | | |
| |||
0 commit comments