aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-01-16 03:50:16 +0000
committerJohn McCall <rjmccall@apple.com>2010-01-16 03:50:16 +0000
commitf3cf22b3b4535282998d74826ccff970a140258f (patch)
treea2065fb6c77e5fa427d61a8b29769c9dbc49d775 /lib/Sema/SemaOverload.cpp
parent10fa3ccf087e167123fdb0a5e1313c7106c3c1fc (diff)
Fix a use of uninitialized memory in overload diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index e4168eb7c8..884192b733 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -4585,7 +4585,7 @@ void NoteAmbiguousUserConversions(Sema &S, SourceLocation OpLoc,
SourceLocation GetLocationForCandidate(const OverloadCandidate *Cand) {
if (Cand->Function)
return Cand->Function->getLocation();
- if (Cand->Surrogate)
+ if (Cand->IsSurrogate)
return Cand->Surrogate->getLocation();
return SourceLocation();
}
@@ -4596,6 +4596,9 @@ struct CompareOverloadCandidatesForDisplay {
bool operator()(const OverloadCandidate *L,
const OverloadCandidate *R) {
+ // Fast-path this check.
+ if (L == R) return false;
+
// Order first by viability.
if (L->Viable) {
if (!R->Viable) return true;