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

Side by Side Diff: runtime/vm/parser.cc

Issue 1160663004: Fix restoring of async try context in catch clause (issue 23498). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/language/regress_23498_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/ast_transformer.h" 9 #include "vm/ast_transformer.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 9252 matching lines...) Expand 10 before | Expand all | Expand 10 after
9263 SequenceNode* async_code = new(Z) SequenceNode(handler_pos, NULL); 9263 SequenceNode* async_code = new(Z) SequenceNode(handler_pos, NULL);
9264 const TryStack* try_block = try_stack_->outer_try(); 9264 const TryStack* try_block = try_stack_->outer_try();
9265 if (try_block != NULL) { 9265 if (try_block != NULL) {
9266 LocalScope* scope = try_block->try_block()->scope; 9266 LocalScope* scope = try_block->try_block()->scope;
9267 if (scope->function_level() == current_block_->scope->function_level()) { 9267 if (scope->function_level() == current_block_->scope->function_level()) {
9268 LocalVariable* saved_try_ctx = 9268 LocalVariable* saved_try_ctx =
9269 LookupSavedTryContextVar(scope->parent()); 9269 LookupSavedTryContextVar(scope->parent());
9270 LocalVariable* async_saved_try_ctx = 9270 LocalVariable* async_saved_try_ctx =
9271 LookupAsyncSavedTryContextVar(scope->parent(), 9271 LookupAsyncSavedTryContextVar(scope->parent(),
9272 try_block->try_index()); 9272 try_block->try_index());
9273 current_block_->statements->Add( 9273 async_code->Add(
9274 new (Z) StoreLocalNode( 9274 new (Z) StoreLocalNode(
9275 Scanner::kNoSourcePos, 9275 Scanner::kNoSourcePos,
9276 saved_try_ctx, 9276 saved_try_ctx,
9277 new (Z) LoadLocalNode(Scanner::kNoSourcePos, 9277 new (Z) LoadLocalNode(Scanner::kNoSourcePos,
9278 async_saved_try_ctx))); 9278 async_saved_try_ctx)));
9279 } 9279 }
9280 } 9280 }
9281 SaveExceptionAndStacktrace(async_code, 9281 SaveExceptionAndStacktrace(async_code,
9282 exception_var, 9282 exception_var,
9283 stack_trace_var, 9283 stack_trace_var,
(...skipping 4196 matching lines...) Expand 10 before | Expand all | Expand 10 after
13480 void Parser::SkipQualIdent() { 13480 void Parser::SkipQualIdent() {
13481 ASSERT(IsIdentifier()); 13481 ASSERT(IsIdentifier());
13482 ConsumeToken(); 13482 ConsumeToken();
13483 if (CurrentToken() == Token::kPERIOD) { 13483 if (CurrentToken() == Token::kPERIOD) {
13484 ConsumeToken(); // Consume the kPERIOD token. 13484 ConsumeToken(); // Consume the kPERIOD token.
13485 ExpectIdentifier("identifier expected after '.'"); 13485 ExpectIdentifier("identifier expected after '.'");
13486 } 13486 }
13487 } 13487 }
13488 13488
13489 } // namespace dart 13489 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/regress_23498_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698