File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
lib/SILOptimizer/Analysis Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ bool DestructorAnalysis::isSafeType(CanType Ty) {
8080 areTypeParametersSafe (Ty))
8181 return cacheResult (Ty, true );
8282
83+ // Not allowed to look at stored properties of resilient types.
84+ if (Struct->isResilient (Mod->getSwiftModule (),
85+ ResilienceExpansion::Maximal)) {
86+ return cacheResult (Ty, false );
87+ }
88+
8389 // Check the stored properties.
8490 for (auto SP : Struct->getStoredProperties ()) {
8591 if (!isSafeType (SP->getInterfaceType ()->getCanonicalType ()))
@@ -97,6 +103,8 @@ bool DestructorAnalysis::isSafeType(CanType Ty) {
97103 }
98104
99105 // TODO: enum types.
106+ // TODO: Don't forget to check resilience of enum decl, like
107+ // we do for structs above.
100108
101109 return cacheResult (Ty, false );
102110}
You can’t perform that action at this time.
0 commit comments