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) {
1338
1338
// can't handle the payload case here due to the flow problems caused by the
1339
1339
// dependency in between the enum and its data.
1340
1340
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
+
1341
1351
assert (IEAI->getOperand ()->getType ().isAddress () && " Must be an address" );
1342
1352
Builder.setCurrentDebugScope (IEAI->getDebugScope ());
1343
1353
You can’t perform that action at this time.
0 commit comments