diff options
| author | John McCall <rjmccall@apple.com> | 2010-01-16 03:50:16 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-01-16 03:50:16 +0000 |
| commit | 982adb518c34bb8a00d27cf7e42806b57113af9f (patch) | |
| tree | 4f2cf440bcebcd401f2eb1426b2ecbbbe89120aa /clang/lib/Sema/SemaOverload.cpp | |
| parent | a44d8f806b5c4b19c13ec34eecc7b52bec6dcbb3 (diff) | |
| download | bcm5719-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.cpp | 5 |
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; |

