Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0bebf49082ee03d028cd6c079ff4416ae25ddf89
https://github.com/WebKit/WebKit/commit/0bebf49082ee03d028cd6c079ff4416ae25ddf89
Author: Sosuke Suzuki <[email protected]>
Date: 2026-03-02 (Mon, 02 Mar 2026)
Changed paths:
A JSTests/stress/regexp-lookahead-capture-backtrack.js
M Source/JavaScriptCore/yarr/YarrJIT.cpp
Log Message:
-----------
[YARR] Clear captures when backtracking out of positive lookahead in JIT
https://bugs.webkit.org/show_bug.cgi?id=308738
Reviewed by Yusuke Suzuki.
When a positive lookahead with captures succeeds but the following
pattern fails, the JIT leaks stale capture values into subsequent
alternatives. The interpreter already clears them in
backtrackParentheticalAssertionEnd; this patch adds the same logic
to the JIT's ParentheticalAssertionEnd backtrack handler.
"x".match(/(?:(?=(x))y|x)/)
Expected: ["x", undefined]
Actual : ["x", "x"]
Test: JSTests/stress/regexp-lookahead-capture-backtrack.js
* JSTests/stress/regexp-lookahead-capture-backtrack.js: Added.
(shouldBe):
* Source/JavaScriptCore/yarr/YarrJIT.cpp:
Canonical link: https://commits.webkit.org/308517@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications