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

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

Issue 1768093002: [regexp] Fix off-by-one in CharacterRange::Negate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | src/regexp/jsregexp.cc » ('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 #ifndef V8_REGEXP_JSREGEXP_H_ 5 #ifndef V8_REGEXP_JSREGEXP_H_
6 #define V8_REGEXP_JSREGEXP_H_ 6 #define V8_REGEXP_JSREGEXP_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assembler.h" 9 #include "src/assembler.h"
10 #include "src/regexp/regexp-ast.h" 10 #include "src/regexp/regexp-ast.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // A mapping from integers, specified as ranges, to a set of integers. 261 // A mapping from integers, specified as ranges, to a set of integers.
262 // Used for mapping character ranges to choices. 262 // Used for mapping character ranges to choices.
263 class DispatchTable : public ZoneObject { 263 class DispatchTable : public ZoneObject {
264 public: 264 public:
265 explicit DispatchTable(Zone* zone) : tree_(zone) { } 265 explicit DispatchTable(Zone* zone) : tree_(zone) { }
266 266
267 class Entry { 267 class Entry {
268 public: 268 public:
269 Entry() : from_(0), to_(0), out_set_(NULL) { } 269 Entry() : from_(0), to_(0), out_set_(NULL) { }
270 Entry(uc32 from, uc32 to, OutSet* out_set) 270 Entry(uc32 from, uc32 to, OutSet* out_set)
271 : from_(from), to_(to), out_set_(out_set) {} 271 : from_(from), to_(to), out_set_(out_set) {
272 DCHECK(from <= to);
273 }
272 uc32 from() { return from_; } 274 uc32 from() { return from_; }
273 uc32 to() { return to_; } 275 uc32 to() { return to_; }
274 void set_to(uc32 value) { to_ = value; } 276 void set_to(uc32 value) { to_ = value; }
275 void AddValue(int value, Zone* zone) { 277 void AddValue(int value, Zone* zone) {
276 out_set_ = out_set_->Extend(value, zone); 278 out_set_ = out_set_->Extend(value, zone);
277 } 279 }
278 OutSet* out_set() { return out_set_; } 280 OutSet* out_set() { return out_set_; }
279 private: 281 private:
280 uc32 from_; 282 uc32 from_;
281 uc32 to_; 283 uc32 to_;
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 static const int kStringOffset = 0; 1583 static const int kStringOffset = 0;
1582 static const int kPatternOffset = 1; 1584 static const int kPatternOffset = 1;
1583 static const int kArrayOffset = 2; 1585 static const int kArrayOffset = 2;
1584 static const int kLastMatchOffset = 3; 1586 static const int kLastMatchOffset = 3;
1585 }; 1587 };
1586 1588
1587 } // namespace internal 1589 } // namespace internal
1588 } // namespace v8 1590 } // namespace v8
1589 1591
1590 #endif // V8_REGEXP_JSREGEXP_H_ 1592 #endif // V8_REGEXP_JSREGEXP_H_
OLDNEW
« no previous file with comments | « no previous file | src/regexp/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698