mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix double delete in generic specialization.
We ended up adding the same instruction twice to a SmallVector of instructions to be deleted. To avoid this, we'll track these to-be-deleted instructions in a SmallSetVector instead. We were also failing to add an instruction that we can delete to the set of instructions to be deleted, so I fixed that as well. I've added a test case, but it's currently disabled because fixing this turned up another issue in the same code which I still need to take a look at. Fixes rdar://problem/25369617.
This commit is contained in:
@@ -48,7 +48,7 @@ class GenericSpecializer : public SILFunctionTransform {
|
||||
} // end anonymous namespace
|
||||
|
||||
bool GenericSpecializer::specializeAppliesInFunction(SILFunction &F) {
|
||||
llvm::SmallVector<SILInstruction *, 8> DeadApplies;
|
||||
DeadInstructionSet DeadApplies;
|
||||
|
||||
for (auto &BB : F) {
|
||||
for (auto It = BB.begin(), End = BB.end(); It != End;) {
|
||||
|
||||
Reference in New Issue
Block a user