Skip to content

Commit 1952739

Browse files
committed
Compare rvalue types in assertion
Because it is possible for the lowering process to change the flags, this comparison check could trip when the types were, in fact equal, but SIL lowering had optimized storage for the lowered type. In the test case given, the SIL type had flags for Object storage while the lowering type had flags for LocalStorage
1 parent 5e25990 commit 1952739

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ManagedValue SILGenFunction::emitManagedRValueWithCleanup(SILValue v) {
7171

7272
ManagedValue SILGenFunction::emitManagedRValueWithCleanup(SILValue v,
7373
const TypeLowering &lowering) {
74-
assert(lowering.getLoweredType() == v.getType());
74+
assert(lowering.getLoweredType().getSwiftRValueType() == v.getType().getSwiftRValueType());
7575
if (lowering.isTrivial())
7676
return ManagedValue::forUnmanaged(v);
7777

0 commit comments

Comments
 (0)