Index: runtime/vm/scopes.cc |
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc |
index be2cdda24e44df3e4f8ead4de381fc92dfc5df4d..9acac1faec2ce8c136f3c12348827b6c345332bb 100644 |
--- a/runtime/vm/scopes.cc |
+++ b/runtime/vm/scopes.cc |
@@ -616,7 +616,8 @@ void LocalScope::CaptureLocalVariables(LocalScope* top_scope) { |
while (scope != top_scope->parent()) { |
for (intptr_t i = 0; i < scope->num_variables(); i++) { |
LocalVariable* variable = scope->VariableAt(i); |
- if ((variable->name().raw() == Symbols::StackTraceVar().raw()) || |
+ if (variable->is_forced_stack() || |
+ (variable->name().raw() == Symbols::StackTraceVar().raw()) || |
(variable->name().raw() == Symbols::ExceptionVar().raw()) || |
(variable->name().raw() == Symbols::SavedTryContextVar().raw())) { |
// Don't capture those variables because the VM expects them to be on |