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

Side by Side Diff: src/regexp/regexp-parser.cc

Issue 2509843005: [fuzzing] consistently honor --abort-on-stack-overflow. (Closed)
Patch Set: Created 4 years, 1 month 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 | « src/prototype.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 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 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/regexp-parser.h" 5 #include "src/regexp/regexp-parser.h"
6 6
7 #include "src/char-predicates-inl.h" 7 #include "src/char-predicates-inl.h"
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } else { 68 } else {
69 return kEndMarker; 69 return kEndMarker;
70 } 70 }
71 } 71 }
72 72
73 73
74 void RegExpParser::Advance() { 74 void RegExpParser::Advance() {
75 if (has_next()) { 75 if (has_next()) {
76 StackLimitCheck check(isolate()); 76 StackLimitCheck check(isolate());
77 if (check.HasOverflowed()) { 77 if (check.HasOverflowed()) {
78 if (FLAG_abort_on_stack_overflow) FATAL("Aborting on stack overflow");
78 ReportError(CStrVector( 79 ReportError(CStrVector(
79 MessageTemplate::TemplateString(MessageTemplate::kStackOverflow))); 80 MessageTemplate::TemplateString(MessageTemplate::kStackOverflow)));
80 } else if (zone()->excess_allocation()) { 81 } else if (zone()->excess_allocation()) {
81 ReportError(CStrVector("Regular expression too large")); 82 ReportError(CStrVector("Regular expression too large"));
82 } else { 83 } else {
83 current_ = ReadNext<true>(); 84 current_ = ReadNext<true>();
84 } 85 }
85 } else { 86 } else {
86 current_ = kEndMarker; 87 current_ = kEndMarker;
87 // Advance so that position() points to 1-after-the-last-character. This is 88 // Advance so that position() points to 1-after-the-last-character. This is
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1787 return false; 1788 return false;
1788 } 1789 }
1789 terms_.Add(new (zone()) RegExpQuantifier(min, max, quantifier_type, atom), 1790 terms_.Add(new (zone()) RegExpQuantifier(min, max, quantifier_type, atom),
1790 zone()); 1791 zone());
1791 LAST(ADD_TERM); 1792 LAST(ADD_TERM);
1792 return true; 1793 return true;
1793 } 1794 }
1794 1795
1795 } // namespace internal 1796 } // namespace internal
1796 } // namespace v8 1797 } // namespace v8
OLDNEW
« no previous file with comments | « src/prototype.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698