Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9cfacfaca9092f7a1910a6daf679519ebeefac2e
      
https://github.com/WebKit/WebKit/commit/9cfacfaca9092f7a1910a6daf679519ebeefac2e
  Author: Kai Tamkun <[email protected]>
  Date:   2026-05-11 (Mon, 11 May 2026)

  Changed paths:
    A JSTests/stress/string-prototype-replaceAll-rejects-non-global-regexp.js
    M Source/JavaScriptCore/dfg/DFGOperations.cpp

  Log Message:
  -----------
  DFG `operationStringProtoFuncReplaceAllGeneric` skips global flag check for 
RegExp
https://bugs.webkit.org/show_bug.cgi?id=312669
rdar://175067313

Reviewed by Marcus Plutowski.

This patch inserts a check in DFG's operationStringProtoFuncReplaceAllGeneric
that the passed search value, if it's a RegExp, has the "g" flag. If it fails,
throw an exception instead of continuing with the replacement. This matches
the interpreter behavior.
Thanks to Junyoung Park (@candymate) of KAIST Hacking Lab for the fix.

Test: JSTests/stress/string-prototype-replaceAll-rejects-non-global-regexp.js

* JSTests/stress/string-prototype-replaceAll-rejects-non-global-regexp.js: 
Added.
(doReplaceAll):
(catch):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):

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



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

Reply via email to