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

Unified Diff: src/isolate.cc

Issue 1151333005: A couple of other "stack overflow" vs. "has_pending_exception()" issues fixed. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing and try failures fixes Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime-strings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index efa0e28ba06529c788ef3dc6e19e37494b897dd5..7a38e9c32fa3bdb04e46cbe45ee534c1aad725b1 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -945,16 +945,22 @@ void ReportBootstrappingException(Handle<Object> exception,
// builtins, print the actual source here so that line numbers match.
if (location->script()->source()->IsString()) {
Handle<String> src(String::cast(location->script()->source()));
- PrintF("Failing script:\n");
+ PrintF("Failing script:");
int len = src->length();
- int line_number = 1;
- PrintF("%5d: ", line_number);
- for (int i = 0; i < len; i++) {
- uint16_t character = src->Get(i);
- PrintF("%c", character);
- if (character == '\n' && i < len - 2) {
- PrintF("%5d: ", ++line_number);
+ if (len == 0) {
+ PrintF(" <not available>\n");
+ } else {
+ PrintF("\n");
+ int line_number = 1;
+ PrintF("%5d: ", line_number);
+ for (int i = 0; i < len; i++) {
+ uint16_t character = src->Get(i);
+ PrintF("%c", character);
+ if (character == '\n' && i < len - 2) {
+ PrintF("%5d: ", ++line_number);
+ }
}
+ PrintF("\n");
}
}
#endif
« no previous file with comments | « src/debug.cc ('k') | src/runtime/runtime-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698