If a shared case block dest got created before it's case's pattern vars were

initialized, the block arg could get created with the type from an outer scope.
This commit is contained in:
Greg Titus
2017-03-31 23:21:56 -07:00
parent 56ad8bd482
commit b9ecde5fc7
2 changed files with 27 additions and 1 deletions

View File

@@ -2292,7 +2292,7 @@ JumpDest PatternMatchEmission::getSharedCaseBlockDest(CaseStmt *caseBlock,
pattern->forEachVariable([&](VarDecl *V) {
if (!V->hasName())
return;
block->createPHIArgument(SGF.VarLocs[V].value->getType(),
block->createPHIArgument(SGF.getLoweredType(V->getType()),
ValueOwnershipKind::Owned, V);
});
}