Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Yarr] Regex Lookbehinds differs from v8
https://bugs.webkit.org/show_bug.cgi?id=273254 rdar://127440248 Reviewed by Yusuke Suzuki. Updated the checked offset calculation for lookbehinds. The count of characters we need for a lookbehind should not be dependent of the count for the surrounding expression. We now use the minimum checked size selected from either the already checked characters or the parenthesis checked characters (if they are different). The prior code would check the already checked parenthesis count first and then the disjunction's minimum size. Now we take the lessor of the two minimums to compute the amount we need to check when trying to match the lookbehind. We still need to uncheck the appropriate amount based on either the disjunction minimum or parenthesis when we are done handling the lookbehind. That is now handled with the new variable, backwardUncheckAmount. Deleted some dead code discovered while fixing this issue. New test added. * JSTests/stress/regexp-lookbehind.js: * Source/JavaScriptCore/yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::emitDisjunction): Canonical link: https://commits.webkit.org/278863@main
- Loading branch information