Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: src/regexp/jsregexp.cc

Issue 1681873002: [regexp] fix off-by-one in UnicodeRangeSplitter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/unicode-character-ranges.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/regexp/jsregexp.h" 5 #include "src/regexp/jsregexp.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/compilation-cache.h" 9 #include "src/compilation-cache.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 4887 matching lines...) Expand 10 before | Expand all | Expand 10 after
4898 for (int i = 0; i < base->length(); i++) { 4898 for (int i = 0; i < base->length(); i++) {
4899 table_.AddRange(base->at(i), kBase, zone_); 4899 table_.AddRange(base->at(i), kBase, zone_);
4900 } 4900 }
4901 // Add overlay ranges. 4901 // Add overlay ranges.
4902 table_.AddRange(CharacterRange(0, kLeadSurrogateStart - 1), kBmpCodePoints, 4902 table_.AddRange(CharacterRange(0, kLeadSurrogateStart - 1), kBmpCodePoints,
4903 zone_); 4903 zone_);
4904 table_.AddRange(CharacterRange(kLeadSurrogateStart, kLeadSurrogateEnd), 4904 table_.AddRange(CharacterRange(kLeadSurrogateStart, kLeadSurrogateEnd),
4905 kLeadSurrogates, zone_); 4905 kLeadSurrogates, zone_);
4906 table_.AddRange(CharacterRange(kTrailSurrogateStart, kTrailSurrogateEnd), 4906 table_.AddRange(CharacterRange(kTrailSurrogateStart, kTrailSurrogateEnd),
4907 kTrailSurrogates, zone_); 4907 kTrailSurrogates, zone_);
4908 table_.AddRange(CharacterRange(kTrailSurrogateEnd, kNonBmpStart - 1), 4908 table_.AddRange(CharacterRange(kTrailSurrogateEnd + 1, kNonBmpStart - 1),
4909 kBmpCodePoints, zone_); 4909 kBmpCodePoints, zone_);
4910 table_.AddRange(CharacterRange(kNonBmpStart, kNonBmpEnd), kNonBmpCodePoints, 4910 table_.AddRange(CharacterRange(kNonBmpStart, kNonBmpEnd), kNonBmpCodePoints,
4911 zone_); 4911 zone_);
4912 table_.ForEach(this); 4912 table_.ForEach(this);
4913 } 4913 }
4914 4914
4915 4915
4916 void UnicodeRangeSplitter::Call(uc32 from, DispatchTable::Entry entry) { 4916 void UnicodeRangeSplitter::Call(uc32 from, DispatchTable::Entry entry) {
4917 OutSet* outset = entry.out_set(); 4917 OutSet* outset = entry.out_set();
4918 if (!outset->Get(kBase)) return; 4918 if (!outset->Get(kBase)) return;
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after
6875 6875
6876 6876
6877 void RegExpResultsCache::Clear(FixedArray* cache) { 6877 void RegExpResultsCache::Clear(FixedArray* cache) {
6878 for (int i = 0; i < kRegExpResultsCacheSize; i++) { 6878 for (int i = 0; i < kRegExpResultsCacheSize; i++) {
6879 cache->set(i, Smi::FromInt(0)); 6879 cache->set(i, Smi::FromInt(0));
6880 } 6880 }
6881 } 6881 }
6882 6882
6883 } // namespace internal 6883 } // namespace internal
6884 } // namespace v8 6884 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/unicode-character-ranges.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698