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

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

Issue 76963003: Fix crash evaluating metadata with super in a const constructor argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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_constructor_arguments_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 10281 matching lines...) Expand 10 before | Expand all | Expand 10 after
10292 primary = ParseNewOperator(Token::kCONST); 10292 primary = ParseNewOperator(Token::kCONST);
10293 } 10293 }
10294 } else if (CurrentToken() == Token::kLT || 10294 } else if (CurrentToken() == Token::kLT ||
10295 CurrentToken() == Token::kLBRACK || 10295 CurrentToken() == Token::kLBRACK ||
10296 CurrentToken() == Token::kINDEX || 10296 CurrentToken() == Token::kINDEX ||
10297 CurrentToken() == Token::kLBRACE) { 10297 CurrentToken() == Token::kLBRACE) {
10298 primary = ParseCompoundLiteral(); 10298 primary = ParseCompoundLiteral();
10299 } else if (CurrentToken() == Token::kHASH) { 10299 } else if (CurrentToken() == Token::kHASH) {
10300 primary = ParseSymbolLiteral(); 10300 primary = ParseSymbolLiteral();
10301 } else if (CurrentToken() == Token::kSUPER) { 10301 } else if (CurrentToken() == Token::kSUPER) {
10302 if (parsing_metadata_) {
10303 ErrorMsg("cannot access superclass from metadata");
10304 }
10302 if (current_function().is_static()) { 10305 if (current_function().is_static()) {
10303 ErrorMsg("cannot access superclass from static method"); 10306 ErrorMsg("cannot access superclass from static method");
10304 } 10307 }
10305 if (current_class().SuperClass() == Class::null()) { 10308 if (current_class().SuperClass() == Class::null()) {
10306 ErrorMsg("class '%s' does not have a superclass", 10309 ErrorMsg("class '%s' does not have a superclass",
10307 String::Handle(current_class().Name()).ToCString()); 10310 String::Handle(current_class().Name()).ToCString());
10308 } 10311 }
10309 if (current_class().IsMixinApplication()) { 10312 if (current_class().IsMixinApplication()) {
10310 const Type& mixin_type = Type::Handle(current_class().mixin()); 10313 const Type& mixin_type = Type::Handle(current_class().mixin());
10311 if (mixin_type.type_class() == current_function().origin()) { 10314 if (mixin_type.type_class() == current_function().origin()) {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
10692 void Parser::SkipQualIdent() { 10695 void Parser::SkipQualIdent() {
10693 ASSERT(IsIdentifier()); 10696 ASSERT(IsIdentifier());
10694 ConsumeToken(); 10697 ConsumeToken();
10695 if (CurrentToken() == Token::kPERIOD) { 10698 if (CurrentToken() == Token::kPERIOD) {
10696 ConsumeToken(); // Consume the kPERIOD token. 10699 ConsumeToken(); // Consume the kPERIOD token.
10697 ExpectIdentifier("identifier expected after '.'"); 10700 ExpectIdentifier("identifier expected after '.'");
10698 } 10701 }
10699 } 10702 }
10700 10703
10701 } // namespace dart 10704 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/lib/mirrors/metadata_constructor_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698