Repository navigation
Commit 42e3a14
deps: V8: backport d315af3d83cf
Original commit message:
[regexp] Reset compiler flags between word boundary branches
When compiling \b and \B word boundary checks in AssertionNode where the
succeeding character type is unknown, two code paths (before_non_word and
before_word) are generated sequentially.
If the boundary assertion is placed inside a modifier group (e.g.
(?i:\.|\bNULL)), emitting the first branch traverses through on_success
and reaches the ActionNode that restores outer flags at group exit.
This mutates flags without restoring it when returning to emit the
second branch. Consequently, subsequent nodes in the second branch
(before_word) were incorrectly compiled with outer flags instead
of the modifier group's flags.
This CL saves compiler->flags() and restores them before emitting the
before_word branch in AssertionNode::EmitBoundaryCheck.
TAG=agy
Fixed: 544575761
Change-Id: I7f08bcb99c749d5e22636c8bd6eb44bd1d3e2e39
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8257209
Reviewed-by: Victor Gomes <[email protected]>
Commit-Queue: Patrick Thier <[email protected]>
Cr-Commit-Position: refs/heads/main@{#109236}
Refs: v8/v8@d315af3
Refs: nodejs#66277
PR-URL: nodejs#67207
Reviewed-by: Antoine du Hamel <[email protected]>1 parent 9adc368 commit 42e3a14
3 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2134 | 2134 | | |
2135 | 2135 | | |
2136 | 2136 | | |
| 2137 | + | |
2137 | 2138 | | |
2138 | 2139 | | |
2139 | 2140 | | |
| |||
2148 | 2149 | | |
2149 | 2150 | | |
2150 | 2151 | | |
| 2152 | + | |
2151 | 2153 | | |
2152 | 2154 | | |
2153 | 2155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments