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

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

Issue 286903020: Fix crash when parsing metadata that refers to a static getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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_allowed_values_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 9153 matching lines...) Expand 10 before | Expand all | Expand 10 after
9164 } 9164 }
9165 return true; 9165 return true;
9166 } else if (func.IsStaticFunction()) { 9166 } else if (func.IsStaticFunction()) {
9167 if (node != NULL) { 9167 if (node != NULL) {
9168 ASSERT(AbstractType::Handle(func.result_type()).IsResolved()); 9168 ASSERT(AbstractType::Handle(func.result_type()).IsResolved());
9169 // The static getter may later be changed into a dynamically 9169 // The static getter may later be changed into a dynamically
9170 // resolved instance setter if no static setter can 9170 // resolved instance setter if no static setter can
9171 // be found. 9171 // be found.
9172 AstNode* receiver = NULL; 9172 AstNode* receiver = NULL;
9173 const bool kTestOnly = true; 9173 const bool kTestOnly = true;
9174 if (parsing_metadata_) {
9175 ErrorMsg(ident_pos,
9176 "'%s' is not a compile-time constant",
9177 ident.ToCString());
9178 }
9174 if (!current_function().is_static() && 9179 if (!current_function().is_static() &&
9175 (LookupReceiver(current_block_->scope, kTestOnly) != NULL)) { 9180 (LookupReceiver(current_block_->scope, kTestOnly) != NULL)) {
9176 receiver = LoadReceiver(ident_pos); 9181 receiver = LoadReceiver(ident_pos);
9177 } 9182 }
9178 *node = new StaticGetterNode(ident_pos, 9183 *node = new StaticGetterNode(ident_pos,
9179 receiver, 9184 receiver,
9180 false, 9185 false,
9181 Class::ZoneHandle(isolate(), cls.raw()), 9186 Class::ZoneHandle(isolate(), cls.raw()),
9182 ident); 9187 ident);
9183 } 9188 }
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
10949 void Parser::SkipQualIdent() { 10954 void Parser::SkipQualIdent() {
10950 ASSERT(IsIdentifier()); 10955 ASSERT(IsIdentifier());
10951 ConsumeToken(); 10956 ConsumeToken();
10952 if (CurrentToken() == Token::kPERIOD) { 10957 if (CurrentToken() == Token::kPERIOD) {
10953 ConsumeToken(); // Consume the kPERIOD token. 10958 ConsumeToken(); // Consume the kPERIOD token.
10954 ExpectIdentifier("identifier expected after '.'"); 10959 ExpectIdentifier("identifier expected after '.'");
10955 } 10960 }
10956 } 10961 }
10957 10962
10958 } // namespace dart 10963 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/metadata_allowed_values_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698