Skip to content

Commit 46a1435

Browse files
committed
Merge pull request #273 from CodaFi/argh-values
Use a More Specific Assert for RValue Type Lowering
2 parents 4b8fff4 + e0b4d55 commit 46a1435

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-swift-frontend %s -emit-ir
2+
3+
// Distributed under the terms of the MIT license
4+
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
5+
6+
struct S<T> {
7+
init(f: AutoreleasingUnsafeMutablePointer<T?> -> ()) {
8+
var t: T?
9+
f(&t)
10+
}
11+
}
12+

0 commit comments

Comments
 (0)