Repository navigation
Commit df1b8db
deps: V8: backport 1e7ee91de775
Original commit message:
[regexp] Reset flags between negative lookaround branches
e540e1161b0 (bug 510487690) reset the analysis-time flags between the
alternatives of a ChoiceNode, since an alternative's sub-graph may
contain a MODIFY_FLAGS node. NegativeLookaroundChoiceNode has its own
visitor and was left out, so a modifier group inside a negative
lookaround still leaks its flags into the continuation.
/(?!(?i:x|y))[K]/.exec('kz') // "k", should be null
The lookaround body is visited first and leaves the group's flags
behind; the continuation's class ranges are then made case independent
under those flags rather than the pattern's, so [K] picks up 'k'.
Only class ranges are affected: TextNode::MakeCaseIndependent
materializes the equivalents during analysis, while atoms get their case
closure at emission time from the restored flags. A single- alternative
body does not reproduce either, since its restore node is emitted last.
Change-Id: I4077076b9dbee6acf75918a2c4f7bf7d86cab059
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8175612
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109043}
Refs: v8/v8@1e7ee91
Co-authored-by: Radu Samson <radu.samson@ext.ec.europa.eu>
Refs: #66277
PR-URL: #67207
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>1 parent 42e3a14 commit df1b8db
3 files changed
Lines changed: 11 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 | |
|---|---|---|---|
| |||
3889 | 3889 | | |
3890 | 3890 | | |
3891 | 3891 | | |
| 3892 | + | |
3892 | 3893 | | |
3893 | 3894 | | |
3894 | 3895 | | |
3895 | 3896 | | |
3896 | 3897 | | |
| 3898 | + | |
3897 | 3899 | | |
3898 | 3900 | | |
3899 | 3901 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
0 commit comments