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

Unified Diff: runtime/vm/parser.cc

Issue 10807055: Fix build break, i.e. fix type finalization for function literals not assigned (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 9784)
+++ runtime/vm/parser.cc (working copy)
@@ -4318,19 +4318,24 @@
// Since the signature type is cached by the signature class, it may have
// been finalized already.
Type& signature_type = Type::Handle(signature_class.SignatureType());
- const AbstractTypeArguments& signature_type_arguments =
+ AbstractTypeArguments& signature_type_arguments =
AbstractTypeArguments::Handle(signature_type.arguments());
if (!signature_type.IsFinalized()) {
signature_type ^= ClassFinalizer::FinalizeType(
signature_class, signature_type, ClassFinalizer::kCanonicalize);
+
// The call to ClassFinalizer::FinalizeType may have
// extended the vector of type arguments.
- ASSERT(signature_type_arguments.IsNull() ||
+ signature_type_arguments = signature_type.arguments();
+ ASSERT(signature_type.IsMalformed() ||
+ signature_type_arguments.IsNull() ||
(signature_type_arguments.Length() ==
signature_class.NumTypeArguments()));
+
// The signature_class should not have changed.
- ASSERT(signature_type.type_class() == signature_class.raw());
+ ASSERT(signature_type.IsMalformed() ||
+ (signature_type.type_class() == signature_class.raw()));
}
if (variable_name != NULL) {
@@ -4338,6 +4343,12 @@
function_type.set_type_class(signature_class);
function_type.set_arguments(signature_type_arguments);
+ // Mark the function type as malformed if the signature type is malformed.
+ if (signature_type.IsMalformed()) {
+ const Error& error = Error::Handle(signature_type.malformed_error());
+ function_type.set_malformed_error(error);
+ }
+
// The function variable type should have been patched above.
ASSERT((function_variable == NULL) ||
(function_variable->type().raw() == function_type.raw()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698