File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
lib/SILOptimizer/SILCombiner Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1338,6 +1338,16 @@ SILCombiner::visitInjectEnumAddrInst(InjectEnumAddrInst *IEAI) {
13381338 // can't handle the payload case here due to the flow problems caused by the
13391339 // dependency in between the enum and its data.
13401340
1341+ // Disable this for empty typle type because empty tuple stack locations maybe
1342+ // uninitialized. And converting to value form loses tag information.
1343+ if (IEAI->getElement ()->hasAssociatedValues ()) {
1344+ SILType elemType = IEAI->getOperand ()->getType ().getEnumElementType (
1345+ IEAI->getElement (), IEAI->getFunction ());
1346+ if (elemType.isEmpty (*IEAI->getFunction ())) {
1347+ return nullptr ;
1348+ }
1349+ }
1350+
13411351 assert (IEAI->getOperand ()->getType ().isAddress () && " Must be an address" );
13421352 Builder.setCurrentDebugScope (IEAI->getDebugScope ());
13431353
You can’t perform that action at this time.
0 commit comments