Skip to content

Commit f8a1e31

Browse files
authored
Merge pull request #3508 from gregomni/bug2059
[SILGen] Memory management bug fix here for indirect nested enums in switch cases.
2 parents 9fd632d + fc4fe97 commit f8a1e31

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/SILGen/SILGenPattern.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,8 +2275,7 @@ void SILGenFunction::emitSwitchStmt(SwitchStmt *S) {
22752275

22762276
for (auto cmv : argArray) {
22772277
if (cmv.getValue() == value) {
2278-
if (cmv.hasCleanup())
2279-
B.createRetainValue(CurrentSILLoc, value, Atomicity::Atomic);
2278+
B.createRetainValue(CurrentSILLoc, value, Atomicity::Atomic);
22802279
break;
22812280
}
22822281
}

0 commit comments

Comments
 (0)