mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Definite initialization for initializers relying on a separate ivar initializer.
When we decide to emit a separate ivar initializer method (via the Objective-C entry point -.cxx_construct), we no longer initialize the ivars within the initializer. This only happens for derived classes, so teach DI about uninitialized 'self' values that require a super.init call but don't require the ivars to be initialized. Swift SVN r12240
This commit is contained in:
@@ -78,7 +78,14 @@ DIMemoryObjectInfo::DIMemoryObjectInfo(SILInstruction *MI) {
|
||||
NumElements = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If this is a derived class init method for which stored properties are
|
||||
// separately initialized, track an element for the super.init call.
|
||||
if (isDerivedClassSelfOnly()) {
|
||||
NumElements = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, we break down the initializer.
|
||||
NumElements = getElementCountRec(getType(), IsSelfOfNonDelegatingInitializer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user