Skip to content

[YARR] End subpattern index must be checked with -1#58906

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Constellation:eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1
Feb 18, 2026
Merged

[YARR] End subpattern index must be checked with -1#58906
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Constellation:eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1

Conversation

@Constellation
Copy link
Member

@Constellation Constellation commented Feb 18, 2026

88bc2e3

[YARR] End subpattern index must be checked with -1
https://bugs.webkit.org/show_bug.cgi?id=308112
rdar://170535154

Reviewed by Yijia Huang.

As it is demonstrated in 306841@main, FixedCount parentheses clears both
begin and end. And set begin index when it starts. And when it succeeds,
end index is filled with the right value. So, if we would like to know
whether the subpattern is active or not, we should look into end index
side instead of begin index.

We also clean up some initialization code for subpatterns and duplicate
named groups.

Test: JSTests/stress/yarr-jit-backreference-partially-captured-subpattern.js

* JSTests/stress/yarr-jit-backreference-partially-captured-subpattern.js: Added.
* Source/JavaScriptCore/yarr/YarrJIT.cpp:

Canonical link: https://commits.webkit.org/307776@main

0c15a0c

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ⏳ 🛠 ios-apple
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests ❌ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ⏳ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-debug-arm64 ✅ 🛠 vision ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🛠 tv ✅ 🧪 mac-intel-wk2 ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🛠 mac-safer-cpp ✅ 🧪 jsc-armv7-tests
loading 🛠 watch
✅ 🛠 watch-sim

@Constellation Constellation requested a review from a team as a code owner February 18, 2026 07:24
@Constellation Constellation self-assigned this Feb 18, 2026
@Constellation Constellation added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Feb 18, 2026
@Constellation Constellation changed the title [YARR] Both begin and end subpattern index must be checked with -1 [YARR] End subpattern index must be checked with -1 Feb 18, 2026
@Constellation Constellation force-pushed the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch from 5fe6d81 to d0c63be Compare February 18, 2026 07:29
@Constellation Constellation force-pushed the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch from d0c63be to e7f9d68 Compare February 18, 2026 07:54
@Constellation Constellation force-pushed the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch from e7f9d68 to c15754e Compare February 18, 2026 08:03
@Constellation Constellation force-pushed the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch from c15754e to d1186af Compare February 18, 2026 08:08
@Constellation Constellation force-pushed the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch from d1186af to 0c15a0c Compare February 18, 2026 08:13
@Constellation Constellation added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 18, 2026
@webkit-commit-queue webkit-commit-queue force-pushed the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch from 0c15a0c to 8827cd8 Compare February 18, 2026 19:38
https://bugs.webkit.org/show_bug.cgi?id=308112
rdar://170535154

Reviewed by Yijia Huang.

As it is demonstrated in 306841@main, FixedCount parentheses clears both
begin and end. And set begin index when it starts. And when it succeeds,
end index is filled with the right value. So, if we would like to know
whether the subpattern is active or not, we should look into end index
side instead of begin index.

We also clean up some initialization code for subpatterns and duplicate
named groups.

Test: JSTests/stress/yarr-jit-backreference-partially-captured-subpattern.js

* JSTests/stress/yarr-jit-backreference-partially-captured-subpattern.js: Added.
* Source/JavaScriptCore/yarr/YarrJIT.cpp:

Canonical link: https://commits.webkit.org/307776@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch from 8827cd8 to 88bc2e3 Compare February 18, 2026 19:39
@webkit-commit-queue
Copy link
Collaborator

Committed 307776@main (88bc2e3): https://commits.webkit.org/307776@main

Reviewed commits have been landed. Closing PR #58906 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 88bc2e3 into WebKit:main Feb 18, 2026
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 18, 2026
@Constellation Constellation deleted the eng/YARR-Both-begin-and-end-subpattern-index-must-be-checked-with-1 branch February 18, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants