mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Zero-initialize structs in constructors.
Otherwise we try to release junk pointers when we reassign class fields in the struct. Add an attribute to InitializeVarInst so that when dataflow analysis comes online, it knows that these InitializeVars need to be eliminated and can't be lowered to default constructor calls (since we're already in a constructor). Swift SVN r4730
This commit is contained in:
@@ -164,8 +164,9 @@ public:
|
||||
}
|
||||
|
||||
InitializeVarInst *createInitializeVar(SILLocation Loc,
|
||||
SILValue DestLValue) {
|
||||
return insert(new InitializeVarInst(Loc, DestLValue));
|
||||
SILValue DestLValue,
|
||||
bool canDefaultConstruct) {
|
||||
return insert(new InitializeVarInst(Loc, DestLValue, canDefaultConstruct));
|
||||
}
|
||||
|
||||
CopyAddrInst *createCopyAddr(SILLocation Loc,
|
||||
|
||||
Reference in New Issue
Block a user