Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8cfdd1d58057ff6fa49d2918b1d853368fdc7c25
      
https://github.com/WebKit/WebKit/commit/8cfdd1d58057ff6fa49d2918b1d853368fdc7c25
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-03-12 (Thu, 12 Mar 2026)

  Changed paths:
    A JSTests/stress/regexp-prototype-matchall-lastindex-tolength.js
    M Source/JavaScriptCore/runtime/RegExpPrototype.cpp

  Log Message:
  -----------
  [JSC] `RegExp#@@matchAll` fast path should clamp lastIndex > 2^53-1 to 2^53-1
https://bugs.webkit.org/show_bug.cgi?id=309470

Reviewed by Yusuke Suzuki.

The fast path in regExpProtoFuncMatchAll incorrectly treated lastIndex values
exceeding Number.MAX_SAFE_INTEGER as 0. Per spec, ToLength clamps such values
to 2^53-1[1][2]. Regression from 4b4cd07889.

[1]: https://tc39.es/ecma262/#sec-string.prototype.matchall
[2]: https://tc39.es/ecma262/#sec-tolength

Test: JSTests/stress/regexp-prototype-matchall-lastindex-tolength.js

* JSTests/stress/regexp-prototype-matchall-lastindex-tolength.js: Added.
(shouldBe):
(testSlowPath.MyRegExp):
(testSlowPath):
* Source/JavaScriptCore/runtime/RegExpPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to