Opaques: initialize optionals by-value under new opaque value mode

This commit is contained in:
Joe Shajrawi
2017-02-17 10:55:57 -08:00
parent d4c341b154
commit 831769b446
2 changed files with 16 additions and 1 deletions

View File

@@ -3939,7 +3939,7 @@ ManagedValue SILGenFunction::emitInjectEnum(SILLocation loc,
}
// Loadable with payload
if (enumTy.isLoadable(SGM.M)) {
if (enumTy.isLoadable(SGM.M) || !silConv.useLoweredAddresses()) {
if (!payloadMV) {
// If the payload was indirect, we already evaluated it and
// have a single value. Otherwise, evaluate the payload.