Skip to content

Commit bca95eb

Browse files
pthieraduh95
authored andcommitted
deps: V8: backport e540e1161b02
Original commit message: [regexp] Fix modifiers for ChoiceNodes during Analysis During the analysis pass we didn't reset flags after visiting alternatives of a ChoiceNode, which is required as the sub-graph of an alternative might modify the flags. Fixed: 510487690 Change-Id: I6b2660a98b34cd12740538af4ce61685609934a0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7826630 Commit-Queue: Patrick Thier <[email protected]> Auto-Submit: Patrick Thier <[email protected]> Reviewed-by: Jakob Linke <[email protected]> Commit-Queue: Jakob Linke <[email protected]> Cr-Commit-Position: refs/heads/main@{#107120} Refs: v8/v8@e540e11 Refs: nodejs#66277 PR-URL: nodejs#67207 Reviewed-by: Antoine du Hamel <[email protected]>
1 parent 190faa4 commit bca95eb

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎common.gypi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
# Reset this number to 0 on major V8 upgrades.
4646
# Increment by one for each non-official patch applied to deps/v8.
47-
'v8_embedder_string': '-node.43',
47+
'v8_embedder_string': '-node.44',
4848

4949
##### V8 defaults for Node.js #####
5050

‎deps/v8/src/regexp/regexp-compiler.cc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3841,8 +3841,13 @@ class Analysis : public NodeVisitor {
38413841
}
38423842

38433843
void VisitChoice(ChoiceNode* that) override {
3844+
// Flags need to be reset to the state of the ChoiceNode at the beginning
3845+
// of each alternative, as flags might be modified when visiting an
3846+
// alternative.
3847+
RegExpFlags header_flags = flags();
38443848
for (int i = 0; i < that->alternatives()->length(); i++) {
38453849
EnsureAnalyzed(that->alternatives()->at(i).node());
3850+
set_flags(header_flags);
38463851
if (has_failed()) return;
38473852
STATIC_FOR_EACH(Propagators::VisitChoice(that, i));
38483853
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright 2026 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
assertTrue(/(?i:x|[a-f])/.test("F"));

0 commit comments

Comments
 (0)