Skip to content

Commit 782a5b4

Browse files
committed
[CS] Ensure we trap in getOverloadChoice if the overload is missing
Using `*` previously meant we'd invoke undefined behavior.
1 parent 75d60b3 commit 782a5b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,7 @@ class Solution {
17641764
/// Retrieve the overload choice associated with the given
17651765
/// locator.
17661766
SelectedOverload getOverloadChoice(ConstraintLocator *locator) const {
1767-
return *getOverloadChoiceIfAvailable(locator);
1767+
return getOverloadChoiceIfAvailable(locator).value();
17681768
}
17691769

17701770
/// Retrieve the overload choice for the callee associated with the given

0 commit comments

Comments
 (0)