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

Unified Diff: runtime/vm/ast_transformer.cc

Issue 1007393004: Fix temp variable allocation in await transformation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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/ast_transformer.cc
===================================================================
--- runtime/vm/ast_transformer.cc (revision 44518)
+++ runtime/vm/ast_transformer.cc (working copy)
@@ -66,10 +66,10 @@
Z, String::NewFormatted("%s%d", await_temp_prefix, temp_cnt_));
const String& symbol = String::ZoneHandle(Z, Symbols::New(cnt_str));
ASSERT(!symbol.IsNull());
- // Look up the variable through the preamble scope.
- LocalVariable* await_tmp = preamble_->scope()->LookupVariable(symbol, false);
+ // Look up the variable in the scope used for async temp variables.
+ LocalVariable* await_tmp = function_top_->LocalLookupVariable(symbol);
if (await_tmp == NULL) {
- // If we need a new temp variable, we add it to the function's top scope.
+ // We need a new temp variable; add it to the function's top scope.
await_tmp = new (Z) LocalVariable(
Scanner::kNoSourcePos, symbol, Type::ZoneHandle(Type::DynamicType()));
function_top_->AddVariable(await_tmp);
« 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