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

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

Issue 180313003: Fix VM crash when parsing what looks like a closure call during metadata evaluation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: improve test Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/lib/mirrors/metadata_nested_constructor_call_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/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 7645 matching lines...) Expand 10 before | Expand all | Expand 10 after
7656 7656
7657 7657
7658 void Parser::EnsureExpressionTemp() { 7658 void Parser::EnsureExpressionTemp() {
7659 // Temporary used later by the flow_graph_builder. 7659 // Temporary used later by the flow_graph_builder.
7660 parsed_function()->EnsureExpressionTemp(); 7660 parsed_function()->EnsureExpressionTemp();
7661 } 7661 }
7662 7662
7663 7663
7664 void Parser::EnsureSavedCurrentContext() { 7664 void Parser::EnsureSavedCurrentContext() {
7665 // Used later by the flow_graph_builder to save current context. 7665 // Used later by the flow_graph_builder to save current context.
7666 if (parsing_metadata_) {
7667 return;
hausner 2014/02/27 18:53:22 Can you please explain in a comment why it is nece
rmacnak 2014/02/27 19:11:27 Hm, actually this is dubious because it relies on
7668 }
7666 if (!parsed_function()->has_saved_current_context_var()) { 7669 if (!parsed_function()->has_saved_current_context_var()) {
7667 LocalVariable* temp = 7670 LocalVariable* temp =
7668 new LocalVariable(current_function().token_pos(), 7671 new LocalVariable(current_function().token_pos(),
7669 Symbols::SavedCurrentContextVar(), 7672 Symbols::SavedCurrentContextVar(),
7670 Type::ZoneHandle(Type::DynamicType())); 7673 Type::ZoneHandle(Type::DynamicType()));
7671 ASSERT(temp != NULL); 7674 ASSERT(temp != NULL);
7672 parsed_function()->set_saved_current_context_var(temp); 7675 parsed_function()->set_saved_current_context_var(temp);
7673 } 7676 }
7674 } 7677 }
7675 7678
(...skipping 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after
10778 void Parser::SkipQualIdent() { 10781 void Parser::SkipQualIdent() {
10779 ASSERT(IsIdentifier()); 10782 ASSERT(IsIdentifier());
10780 ConsumeToken(); 10783 ConsumeToken();
10781 if (CurrentToken() == Token::kPERIOD) { 10784 if (CurrentToken() == Token::kPERIOD) {
10782 ConsumeToken(); // Consume the kPERIOD token. 10785 ConsumeToken(); // Consume the kPERIOD token.
10783 ExpectIdentifier("identifier expected after '.'"); 10786 ExpectIdentifier("identifier expected after '.'");
10784 } 10787 }
10785 } 10788 }
10786 10789
10787 } // namespace dart 10790 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/metadata_nested_constructor_call_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698