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

Unified Diff: runtime/vm/parser.cc

Issue 2359543003: Make sure unresolved function type parameter bounds do not end up in snapshot. (Closed)
Patch Set: address Siva/s comments Created 4 years, 3 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 | « runtime/vm/object.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 29063788a885f149d9e0ee004e0e29e910e467f0..def0cfd583cb573064b429c24724fccc03f15323 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -2144,7 +2144,7 @@ void Parser::ParseFormalParameter(bool allow_explicit_default_value,
ASSERT(innermost_function().raw() == signature_function.raw());
innermost_function_ = signature_function.parent_function();
- signature_function.set_data(Object::Handle());
+ signature_function.set_data(Object::Handle(Z));
Type& signature_type =
Type::ZoneHandle(Z, signature_function.SignatureType());
@@ -5481,6 +5481,12 @@ void Parser::ParseTypeParameters(bool parameterizing_class) {
// Postpone resolution in order to avoid resolving the owner and its
// type parameters, as they are not fully parsed yet.
type_parameter_bound = ParseType(ClassFinalizer::kDoNotResolve);
+ if (!parameterizing_class) {
+ // TODO(regis): Resolve and finalize function type parameter bounds in
+ // class finalizer. For now, ignore parsed bounds to avoid unresolved
+ // bounds while writing snapshots.
+ type_parameter_bound = I->object_store()->object_type();
+ }
} else {
type_parameter_bound = I->object_store()->object_type();
}
@@ -5491,6 +5497,11 @@ void Parser::ParseTypeParameters(bool parameterizing_class) {
type_parameter_name,
type_parameter_bound,
declaration_pos);
+ if (!parameterizing_class) {
+ // TODO(regis): Resolve and finalize function type parameter in
+ // class finalizer. For now, already mark as finalized.
+ type_parameter.SetIsFinalized();
+ }
type_parameters_array.Add(
&AbstractType::ZoneHandle(Z, type_parameter.raw()));
if (FLAG_enable_mirrors && metadata_pos.IsReal()) {
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698