summaryrefslogtreecommitdiffstats
path: root/clang/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
commit982adb518c34bb8a00d27cf7e42806b57113af9f (patch)
tree4f2cf440bcebcd401f2eb1426b2ecbbbe89120aa /clang/lib/Sema/SemaOverload.cpp
parenta44d8f806b5c4b19c13ec34eecc7b52bec6dcbb3 (diff)
downloadbcm5719-llvm-982adb518c34bb8a00d27cf7e42806b57113af9f.tar.gz
bcm5719-llvm-982adb518c34bb8a00d27cf7e42806b57113af9f.zip
Fix a use of uninitialized memory in overload diagnostics.
llvm-svn: 93629
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index e4168eb7c88..884192b7336 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud