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

Unified Diff: runtime/vm/object.h

Issue 2822323002: More work on finalization of recursive types (fixes #29357). (Closed)
Patch Set: Created 3 years, 8 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/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index d7640482c0235ea3f5274477ca033a386ab12a82..4251e1ef59dc6155be6824631bb1edab2af2b6a0 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -6044,15 +6044,18 @@ class Type : public AbstractType {
// A TypeRef is used to break cycles in the representation of recursive types.
-// Its only field is the recursive AbstractType it refers to.
+// Its only field is the recursive AbstractType it refers to, which can
+// temporarily be null during finalization.
// Note that the cycle always involves type arguments.
class TypeRef : public AbstractType {
public:
virtual bool IsFinalized() const {
- return AbstractType::Handle(type()).IsFinalized();
+ const AbstractType& ref_type = AbstractType::Handle(type());
+ return !ref_type.IsNull() && ref_type.IsFinalized();
}
virtual bool IsBeingFinalized() const {
- return AbstractType::Handle(type()).IsBeingFinalized();
+ const AbstractType& ref_type = AbstractType::Handle(type());
+ return ref_type.IsNull() || ref_type.IsBeingFinalized();
}
virtual bool IsMalformed() const {
return AbstractType::Handle(type()).IsMalformed();
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698