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

Unified Diff: runtime/vm/object.cc

Issue 1709383002: Improve behaviour when we hit a stack overflow / OOM error (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « runtime/vm/isolate.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 93f2818be2c00f6f948d0d9afdcc0d3d6ec9ae39..e5e9109cdb39813f4c8ad52ace40f48bf29da0f1 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -21079,7 +21079,7 @@ const char* Stacktrace::ToCStringInternal(intptr_t* frame_index,
for (intptr_t i = 0; (i < Length()) && (*frame_index < max_frames); i++) {
function = FunctionAtFrame(i);
if (function.IsNull()) {
- // Check if null function object indicates a gap in a StackOverflow or
+ // Check for a null function, which indicates a gap in a StackOverflow or
// OutOfMemory trace.
if ((i < (Length() - 1)) &&
(FunctionAtFrame(i + 1) != Function::null())) {
@@ -21089,6 +21089,9 @@ const char* Stacktrace::ToCStringInternal(intptr_t* frame_index,
OS::SNPrint(chars, truncated_len, "%s", kTruncated);
frame_strings.Add(chars);
total_len += truncated_len;
+ ASSERT(PcOffsetAtFrame(i) != Smi::null());
+ // To account for gap frames.
+ (*frame_index) += Smi::Value(PcOffsetAtFrame(i));
}
} else {
code = CodeAtFrame(i);
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698