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

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

Issue 10280007: Check upper bounds of type arguments when allocating objects of a generic type (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « runtime/vm/object.cc ('k') | tests/language/generic_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 "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 7835 matching lines...) Expand 10 before | Expand all | Expand 10 after
7846 if (!type_arguments.IsNull() && 7846 if (!type_arguments.IsNull() &&
7847 !type_arguments.IsInstantiated() && 7847 !type_arguments.IsInstantiated() &&
7848 (current_block_->scope->function_level() > 0)) { 7848 (current_block_->scope->function_level() > 0)) {
7849 // Make sure that the instantiator is captured. 7849 // Make sure that the instantiator is captured.
7850 CaptureReceiver(); 7850 CaptureReceiver();
7851 } 7851 }
7852 if (type.IsMalformed()) { 7852 if (type.IsMalformed()) {
7853 // Compile the throw of a dynamic type error due to a bound error. 7853 // Compile the throw of a dynamic type error due to a bound error.
7854 return ThrowTypeError(type_pos, type); 7854 return ThrowTypeError(type_pos, type);
7855 } 7855 }
7856 // TODO(regis): If the type argument vector is not instantiated, we need to 7856 // If the type argument vector is not instantiated, we verify in checked
7857 // verify in checked mode at runtime that it is within its declared bounds. 7857 // mode at runtime that it is within its declared bounds.
7858 new_object = new ConstructorCallNode( 7858 new_object = new ConstructorCallNode(
7859 new_pos, type_arguments, constructor, arguments); 7859 new_pos, type_arguments, constructor, arguments);
7860 } 7860 }
7861 return new_object; 7861 return new_object;
7862 } 7862 }
7863 7863
7864 7864
7865 String& Parser::Interpolate(ArrayNode* values) { 7865 String& Parser::Interpolate(ArrayNode* values) {
7866 const String& class_name = 7866 const String& class_name =
7867 String::Handle(String::NewSymbol(kStringClassName)); 7867 String::Handle(String::NewSymbol(kStringClassName));
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
8426 void Parser::SkipQualIdent() { 8426 void Parser::SkipQualIdent() {
8427 ASSERT(IsIdentifier()); 8427 ASSERT(IsIdentifier());
8428 ConsumeToken(); 8428 ConsumeToken();
8429 if (CurrentToken() == Token::kPERIOD) { 8429 if (CurrentToken() == Token::kPERIOD) {
8430 ConsumeToken(); // Consume the kPERIOD token. 8430 ConsumeToken(); // Consume the kPERIOD token.
8431 ExpectIdentifier("identifier expected after '.'"); 8431 ExpectIdentifier("identifier expected after '.'");
8432 } 8432 }
8433 } 8433 }
8434 8434
8435 } // namespace dart 8435 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/language/generic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698