mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
The VM only marked patterns as anchored when the first real instruction was AssertStart. That missed anchors hidden behind capture setup or a leading positive lookahead, so patterns like /(^bar)/ and /(?=^bar)\w+/ fell back to whole-subject scanning. Teach the hint analysis to see through the non-consuming wrappers we emit ahead of a leading ^, but still run the literal prefilters before anchored and sticky VM attempts. Missing required literals should stay cheap no-matches instead of running the full backtracking VM and raising the step limit. The RegExp runtime test now covers the Chromium ascii-regexp-subject case on a long ASCII input and anchored, sticky, and global no-match cases where the required literal is absent.