Skip to content

Commit 1c15f47

Browse files
committed
---
yaml --- r: 348655 b: refs/heads/master c: 3f44b65 h: refs/heads/master i: 348653: c544402 348651: e5a1d1c 348647: 19e86b6 348639: 958e277
1 parent 3e892eb commit 1c15f47

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2ff5de58b24d11ec51da7c8ea0d51511e740cce3
2+
refs/heads/master: 3f44b65bb3304d4f6c44dfe82ef64ceaf9e57efb
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/SILGen/SILGenLValue.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,8 +1431,6 @@ namespace {
14311431
// Create the allocating setter function. It captures the base address.
14321432
auto setterInfo = SGF.getConstantInfo(setter);
14331433
SILValue setterFRef = SGF.emitGlobalFunctionRef(loc, setter, setterInfo);
1434-
auto setterSubs = SGF.getFunction().getForwardingSubstitutionMap();
1435-
14361434
CanSILFunctionType setterTy = setterFRef->getType().castTo<SILFunctionType>();
14371435
SILFunctionConventions setterConv(setterTy, SGF.SGM.M);
14381436

@@ -1446,7 +1444,7 @@ namespace {
14461444

14471445
PartialApplyInst *setterPAI =
14481446
SGF.B.createPartialApply(loc, setterFRef,
1449-
setterSubs, { capturedBase },
1447+
Substitutions, { capturedBase },
14501448
ParameterConvention::Direct_Guaranteed);
14511449
ManagedValue setterFn = SGF.emitManagedRValueWithCleanup(setterPAI);
14521450

trunk/test/SILOptimizer/di_property_wrappers.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ struct IntStruct {
6161
}
6262
wrapped = 27
6363
}
64+
65+
// Check that we don't crash if the function has unrelated generic parameters.
66+
// SR-11484
67+
mutating func setit<V>(_ v: V) {
68+
wrapped = 5
69+
}
6470
}
6571

6672
final class IntClass {
@@ -142,10 +148,15 @@ func testIntStruct() {
142148

143149
// CHECK-NEXT: .. init 42
144150
// CHECK-NEXT: .. set 27
145-
let t1 = IntStruct()
151+
var t1 = IntStruct()
146152
// CHECK-NEXT: 27
147153
print(t1.wrapped)
148154

155+
// CHECK-NEXT: .. set 5
156+
t1.setit(false)
157+
// CHECK-NEXT: 5
158+
print(t1.wrapped)
159+
149160
// CHECK-NEXT: .. init 42
150161
let t2 = IntStruct(conditional: false)
151162
// CHECK-NEXT: 42

0 commit comments

Comments
 (0)