Skip to content

Commit 19e7a57

Browse files
pthierv8-scoped@luci-project-accounts.iam.gserviceaccount.com
authored andcommitted
[regexp] Reset flags after resetting state in Parser
When restoring the previous state after parsing a closing parenthesis we also need to restore flags explicitly from the restored state. Fixed: 523687962 Change-Id: I63a5bd9fec2f9b7f6fb43b6893027c3c3d0755f0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7950157 Auto-Submit: Patrick Thier <[email protected]> Commit-Queue: Jakob Linke <[email protected]> Reviewed-by: Jakob Linke <[email protected]> Cr-Commit-Position: refs/heads/main@{#108021}
1 parent afdeb60 commit 19e7a57

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/regexp/regexp-parser.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ Tree* ParserImpl<CharT>::ParseDisjunction() {
978978
// Restore previous state.
979979
state = state->previous_state();
980980
builder = state->builder();
981+
flags_ = builder->flags();
981982

982983
builder->AddAtom(body);
983984
// For compatibility with JSC and ES3, we allow quantifiers after

‎test/mjsunit/regexp-modifiers.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ test(
7373
/(?m:^f(?si:.o)$)/, ['foo', '\nfoO', 'f\no\n', '\nf\rO\n'],
7474
['Foo', 'F\no\n']);
7575
test(/(?i:.oo)/, ['Foo', 'FOO', 'fOo', 'foO']);
76+
77+
test(/(?i:foo)[x-z]/v, ['Foox', 'fOoz'], ['fooX','FooZ']);

0 commit comments

Comments
 (0)