Commit 9cce4ff2 authored by verwaest's avatar verwaest Committed by Commit bot

Clear pending exception on stack overflow in the parser

BUG=450960
LOG=n

Review URL: https://codereview.chromium.org/858213003

Cr-Commit-Position: refs/heads/master@{#26390}
parent a0d0c433
......@@ -166,14 +166,20 @@ RUNTIME_FUNCTION(Runtime_RenderCallSite) {
Zone zone;
if (location.function()->shared()->is_function()) {
CompilationInfo info(location.function(), &zone);
if (!Parser::Parse(&info)) return isolate->heap()->empty_string();
if (!Parser::Parse(&info)) {
isolate->clear_pending_exception();
return isolate->heap()->empty_string();
}
CallPrinter printer(isolate, &zone);
const char* string = printer.Print(info.function(), location.start_pos());
return *isolate->factory()->NewStringFromAsciiChecked(string);
}
CompilationInfo info(location.script(), &zone);
if (!Parser::Parse(&info)) return isolate->heap()->empty_string();
if (!Parser::Parse(&info)) {
isolate->clear_pending_exception();
return isolate->heap()->empty_string();
}
CallPrinter printer(isolate, &zone);
const char* string = printer.Print(info.function(), location.start_pos());
return *isolate->factory()->NewStringFromAsciiChecked(string);
......
// Copyright 2015 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.
// Flags: --stack-size=70
"a".replace(/a/g, "");
function test() {
try {
test();
} catch(e) {
"b".replace(/(b)/g, new []);
}
}
try {
test();
} catch (e) {
}
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