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

Unified Diff: runtime/vm/debugger.cc

Issue 76653004: Remove an invalid assert in converting a dart.core.Stacktrace to a debugger stacktrace. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index c39c3e4f2b630b6912cfc00bef343f6a860c3223..60b8df65a8da5da7aad0feed1127e48ec915e6bb 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -1300,13 +1300,12 @@ DebuggerStackTrace* Debugger::StackTraceFrom(const Stacktrace& ex_trace) {
for (intptr_t i = 0; i < ex_trace.Length(); i++) {
function = ex_trace.FunctionAtFrame(i);
- if (function.IsNull()) {
- // Check if null function object indicates a stack trace overflow.
- // Preallocated stacktraces like StackOverflow or OutOfMemory make skip
- // frames.
- ASSERT((i < (ex_trace.Length() - 1)) &&
- (ex_trace.FunctionAtFrame(i + 1) != Function::null()));
- } else if (function.is_visible()) {
+ // Pre-allocated Stacktraces may include empty slots, either (a) to indicate
+ // where frames were omitted in the case a stack has more frames than the
+ // pre-allocated trace (such as a stack overflow) or (b) because a stack has
+ // fewer frames that the pre-allocated trace (such as memory exhaustion with
+ // a shallow stack).
+ if (!function.IsNull() && function.is_visible()) {
code = ex_trace.CodeAtFrame(i);
ASSERT(function.raw() == code.function());
uword pc = code.EntryPoint() + Smi::Value(ex_trace.PcOffsetAtFrame(i));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698