Skip to content

Commit 49ba28a

Browse files
committed
Outliner: Clear IsBridgedArgument state in between matching
Otherwise, when we mangle a signature of bridged/not_bridged arguments we can see the state from the previous match of another instruction. SR-7426 rdar://39414272
1 parent cee0b9c commit 49ba28a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/SILOptimizer/Transforms/Outliner.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ void ObjCMethodCall::clearState() {
905905
BridgedCall = nullptr;
906906
BridgedArguments.clear();
907907
OutlinedName.clear();
908+
IsBridgedArgument.clear();
908909
}
909910

910911
std::pair<SILFunction *, SILBasicBlock::iterator>

test/SILOptimizer/outliner.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,11 @@ public func dontCrash2(_ c: SomeGenericClass) -> Bool {
157157

158158
return true
159159
}
160+
161+
func dontCrash3() -> String? {
162+
let bundle = Bundle.main
163+
let resource = "common parameter"
164+
165+
return bundle.path(forResource: resource, ofType: "png")
166+
?? bundle.path(forResource: resource, ofType: "apng")
167+
}

0 commit comments

Comments
 (0)