Skip to content

Commit b4f11ef

Browse files
fhinkelofrobots
authored andcommitted
deps: cherry-pick a51f429 from V8 upstream
Original commit message: [regexp] Fix case-insensitive matching for one-byte subjects. The bug occurs because we do not canonicalize character class ranges before adding case equivalents. While adding case equivalents, we abort early for one-byte subject strings, assuming that the ranges are sorted. Which they are not. [email protected] BUG=v8:5199 Review-Url: https://codereview.chromium.org/2159683002 Cr-Commit-Position: refs/heads/master@{nodejs#37833} Fixes: nodejs#7708 PR-URL: nodejs#7833 Reviewed-By: targos - Michaël Zasso <[email protected]> Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]> Reviewed-By: ofrobots - Ali Ijaz Sheikh <[email protected]>
1 parent 4a20869 commit b4f11ef

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 281
14-
#define V8_PATCH_LEVEL 77
14+
#define V8_PATCH_LEVEL 78
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/regexp/jsregexp.cc

+1
Original file line numberDiff line numberDiff line change
@@ -5879,6 +5879,7 @@ Vector<const int> CharacterRange::GetWordBounds() {
58795879
void CharacterRange::AddCaseEquivalents(Isolate* isolate, Zone* zone,
58805880
ZoneList<CharacterRange>* ranges,
58815881
bool is_one_byte) {
5882+
CharacterRange::Canonicalize(ranges);
58825883
int range_count = ranges->length();
58835884
for (int i = 0; i < range_count; i++) {
58845885
CharacterRange range = ranges->at(i);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright 2016 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(/(a[\u1000A])+/i.test('aa'));

0 commit comments

Comments
 (0)