Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d5531cc083bc63a525b1d442f3c102173ae9b17b
      
https://github.com/WebKit/WebKit/commit/d5531cc083bc63a525b1d442f3c102173ae9b17b
  Author: Kai Tamkun <[email protected]>
  Date:   2026-09-04 (Fri, 04 Sep 2026)

  Changed paths:
    A JSTests/stress/new-regexp-untyped-soft-invalid-stale-captures.js
    M Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
    M Source/JavaScriptCore/runtime/RegExp.cpp
    M Source/JavaScriptCore/runtime/RegExp.h
    M Source/JavaScriptCore/runtime/RegExpCache.cpp

  Log Message:
  -----------
  [JSC] Validate RegExps in DFG strength reduction phase
https://bugs.webkit.org/show_bug.cgi?id=316723
rdar://178446883

Reviewed by Yusuke Suzuki.

This patch prevents conversion to NewRegExpUntyped if the regexp in question is 
invalid.

Test: JSTests/stress/new-regexp-untyped-soft-invalid-stale-captures.js

* JSTests/stress/new-regexp-untyped-soft-invalid-stale-captures.js: Added.
(atDepth):
(const.make.eval):
(catch):
(try.catch):
(try.i.catch):
(exposed.i.catch):
* Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* Source/JavaScriptCore/runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
(JSC::RegExp::updateMetadataFromPattern):
(JSC::RegExp::byteCodeCompileIfNecessary):
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
* Source/JavaScriptCore/runtime/RegExp.h:
* Source/JavaScriptCore/runtime/RegExpCache.cpp:
(JSC::RegExpCache::lookupOrCreate):

Originally-landed-as: [email protected] (d74d692503fc). 
rdar://185368575
Canonical link: https://commits.webkit.org/320542@main



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

Reply via email to