Commit 1fe704e1 authored by yangguo's avatar yangguo Committed by Commit bot

[fuzzing] consistently honor --abort-on-stack-overflow.

R=machenbach@chromium.org
BUG=chromium:664068

Review-Url: https://codereview.chromium.org/2509843005
Cr-Commit-Position: refs/heads/master@{#41075}
parent e2563e94
...@@ -1576,14 +1576,13 @@ class StackLimitCheck BASE_EMBEDDED { ...@@ -1576,14 +1576,13 @@ class StackLimitCheck BASE_EMBEDDED {
Isolate* isolate_; Isolate* isolate_;
}; };
#define STACK_CHECK(isolate, result_value) \ #define STACK_CHECK(isolate, result_value) \
do { \ do { \
StackLimitCheck stack_check(isolate); \ StackLimitCheck stack_check(isolate); \
if (stack_check.HasOverflowed()) { \ if (stack_check.HasOverflowed()) { \
isolate->Throw(*isolate->factory()->NewRangeError( \ isolate->StackOverflow(); \
MessageTemplate::kStackOverflow)); \ return result_value; \
return result_value; \ } \
} \
} while (false) } while (false)
// Support for temporarily postponing interrupts. When the outermost // Support for temporarily postponing interrupts. When the outermost
......
...@@ -147,8 +147,7 @@ class PrototypeIterator { ...@@ -147,8 +147,7 @@ class PrototypeIterator {
// we visit to an arbitrarily chosen large number. // we visit to an arbitrarily chosen large number.
seen_proxies_++; seen_proxies_++;
if (seen_proxies_ > kProxyPrototypeLimit) { if (seen_proxies_ > kProxyPrototypeLimit) {
isolate_->Throw( isolate_->StackOverflow();
*isolate_->factory()->NewRangeError(MessageTemplate::kStackOverflow));
return false; return false;
} }
MaybeHandle<Object> proto = MaybeHandle<Object> proto =
......
...@@ -75,6 +75,7 @@ void RegExpParser::Advance() { ...@@ -75,6 +75,7 @@ void RegExpParser::Advance() {
if (has_next()) { if (has_next()) {
StackLimitCheck check(isolate()); StackLimitCheck check(isolate());
if (check.HasOverflowed()) { if (check.HasOverflowed()) {
if (FLAG_abort_on_stack_overflow) FATAL("Aborting on stack overflow");
ReportError(CStrVector( ReportError(CStrVector(
MessageTemplate::TemplateString(MessageTemplate::kStackOverflow))); MessageTemplate::TemplateString(MessageTemplate::kStackOverflow)));
} else if (zone()->excess_allocation()) { } else if (zone()->excess_allocation()) {
......
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