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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 10411070: Properly finalize type with malformed type argument. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 7870)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -679,9 +679,24 @@
AbstractTypeArguments::Handle(parameterized_type.arguments());
if (!arguments.IsNull()) {
intptr_t num_arguments = arguments.Length();
+ AbstractType& type_argument = AbstractType::Handle();
for (intptr_t i = 0; i < num_arguments; i++) {
- AbstractType& type_argument = AbstractType::Handle(arguments.TypeAt(i));
+ type_argument = arguments.TypeAt(i);
type_argument = FinalizeType(cls, type_argument, finalization);
+ if (type_argument.IsMalformed()) {
+ // In production mode, malformed type arguments are mapped to Dynamic.
+ // In checked mode, a type with malformed type arguments is malformed.
+ if (FLAG_enable_type_checks) {
+ const Error& error = Error::Handle(type_argument.malformed_error());
+ const String& type_name = String::Handle(parameterized_type.Name());
+ FinalizeMalformedType(error, cls, parameterized_type, finalization,
+ "type '%s' has malformed type argument",
+ type_name.ToCString());
+ return parameterized_type.raw();
+ } else {
+ type_argument = Type::DynamicType();
+ }
+ }
arguments.SetTypeAt(i, type_argument);
}
}
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698