Index: src/frames.cc |
diff --git a/src/frames.cc b/src/frames.cc |
index e89dd5639a3a3081292b7072b072dde5378fe90e..ef38a1b47005005cc058cb2b61506976325f3ab9 100644 |
--- a/src/frames.cc |
+++ b/src/frames.cc |
@@ -1235,6 +1235,10 @@ void JavaScriptFrame::Print(StringStream* accumulator, |
if (this->context() != NULL && this->context()->IsContext()) { |
context = Context::cast(this->context()); |
} |
+ while (context->IsWithContext()) { |
+ context = context->previous(); |
+ ASSERT(context != NULL); |
+ } |
// Print heap-allocated local variables. |
if (heap_locals_count > 0) { |
@@ -1245,8 +1249,9 @@ void JavaScriptFrame::Print(StringStream* accumulator, |
accumulator->PrintName(scope_info->ContextLocalName(i)); |
accumulator->Add(" = "); |
if (context != NULL) { |
- if (i < context->length()) { |
- accumulator->Add("%o", context->get(Context::MIN_CONTEXT_SLOTS + i)); |
+ int index = Context::MIN_CONTEXT_SLOTS + i; |
+ if (index < context->length()) { |
+ accumulator->Add("%o", context->get(index)); |
} else { |
accumulator->Add( |
"// warning: missing context slot - inconsistent frame?"); |