deps: cherry-pick a51f429 from V8 upstream · nodejs/node@af63871 · GitHub
Skip to content

Commit af63871

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. R=marja@chromium.org BUG=v8:5199 Review-Url: https://codereview.chromium.org/2159683002 Cr-Commit-Position: refs/heads/master@{#37833} Fixes: #7708 PR-URL: #7834 Ref: #7833 Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
1 parent 980f4da commit af63871

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion

deps/v8/src/regexp/jsregexp.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5877,6 +5877,7 @@ Vector<const int> CharacterRange::GetWordBounds() {
58775877
void CharacterRange::AddCaseEquivalents(Isolate* isolate, Zone* zone,
58785878
ZoneList<CharacterRange>* ranges,
58795879
bool is_one_byte) {
5880+
CharacterRange::Canonicalize(ranges);
58805881
int range_count = ranges->length();
58815882
for (int i = 0; i < range_count; i++) {
58825883
CharacterRange range = ranges->at(i);
Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)