mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: fix a memory leak, related to zombie functions
The leak happened in this scenario: 1. A function becomes dead and gets deleted (which means: it gets added to the zombie-list) 2. A function with the same name is created again. This can happen with specializations. In such a case we just removed the zombie function from the zombie-list without deleting it. But we cannot delete zombie functions, because they might still be referenced by metadata, like debug-info. Therefore the right fix is to resurrect the zombie function if a new function is created with the same name. rdar://problem/66931238
This commit is contained in:
@@ -340,7 +340,7 @@ public:
|
||||
/// Specialization can cause a function that was erased before by dead function
|
||||
/// elimination to become alive again. If this happens we need to remove it
|
||||
/// from the list of zombies.
|
||||
void removeFromZombieList(StringRef Name);
|
||||
SILFunction *removeFromZombieList(StringRef Name);
|
||||
|
||||
/// Erase a global SIL variable from the module.
|
||||
void eraseGlobalVariable(SILGlobalVariable *G);
|
||||
|
||||
Reference in New Issue
Block a user