Commit a51f4297 authored by yangguo's avatar yangguo Committed by Commit bot

[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}
parent 86110796
......@@ -5890,6 +5890,7 @@ Vector<const int> CharacterRange::GetWordBounds() {
void CharacterRange::AddCaseEquivalents(Isolate* isolate, Zone* zone,
ZoneList<CharacterRange>* ranges,
bool is_one_byte) {
CharacterRange::Canonicalize(ranges);
int range_count = ranges->length();
for (int i = 0; i < range_count; i++) {
CharacterRange range = ranges->at(i);
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
assertTrue(/(a[\u1000A])+/i.test('aa'));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment