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

Unified Diff: runtime/vm/debugger.cc

Issue 23410002: Fix issue 12718 - crash when the trying to access context variables in a frame. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | « 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
===================================================================
--- runtime/vm/debugger.cc (revision 26534)
+++ runtime/vm/debugger.cc (working copy)
@@ -535,17 +535,24 @@
intptr_t level_diff = frame_ctx_level - var_ctx_level;
intptr_t ctx_slot = var_info.index;
if (level_diff == 0) {
- *value = ctx_.At(ctx_slot);
+ if ((ctx_slot < ctx_.num_variables()) && (ctx_slot >= 0)) {
+ *value = ctx_.At(ctx_slot);
+ } else {
hausner 2013/08/26 15:27:48 Maybe add a comment here describing that we only g
siva 2013/08/26 16:55:39 Created an issue https://code.google.com/p/dart/is
+ *value = Symbols::New("<unknown>");
+ }
} else {
ASSERT(level_diff > 0);
Context& ctx = Context::Handle(ctx_.raw());
- while (level_diff > 0) {
- ASSERT(!ctx.IsNull());
+ while (level_diff > 0 && !ctx.IsNull()) {
level_diff--;
ctx = ctx.parent();
}
- ASSERT(!ctx.IsNull());
- *value = ctx.At(ctx_slot);
+ if (!ctx.IsNull() &&
+ ((ctx_slot < ctx_.num_variables()) && (ctx_slot >= 0))) {
+ *value = ctx.At(ctx_slot);
+ } else {
+ *value = Symbols::New("<unknown>");
hausner 2013/08/26 15:27:48 ditto.
siva 2013/08/26 16:55:39 Ditto. On 2013/08/26 15:27:48, hausner wrote:
+ }
}
}
}
« 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