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}
This commit is contained in:
parent
a0d0c4333d
commit
9cce4ff285
@ -166,14 +166,20 @@ RUNTIME_FUNCTION(Runtime_RenderCallSite) {
|
|||||||
Zone zone;
|
Zone zone;
|
||||||
if (location.function()->shared()->is_function()) {
|
if (location.function()->shared()->is_function()) {
|
||||||
CompilationInfo info(location.function(), &zone);
|
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);
|
CallPrinter printer(isolate, &zone);
|
||||||
const char* string = printer.Print(info.function(), location.start_pos());
|
const char* string = printer.Print(info.function(), location.start_pos());
|
||||||
return *isolate->factory()->NewStringFromAsciiChecked(string);
|
return *isolate->factory()->NewStringFromAsciiChecked(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
CompilationInfo info(location.script(), &zone);
|
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);
|
CallPrinter printer(isolate, &zone);
|
||||||
const char* string = printer.Print(info.function(), location.start_pos());
|
const char* string = printer.Print(info.function(), location.start_pos());
|
||||||
return *isolate->factory()->NewStringFromAsciiChecked(string);
|
return *isolate->factory()->NewStringFromAsciiChecked(string);
|
||||||
|
20
test/mjsunit/regress/regress-crbug-450960.js
Normal file
20
test/mjsunit/regress/regress-crbug-450960.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// 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) {
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user