From 8d265c26338559eb14bb21a1902d44a1d89bb055 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 1 Apr 2014 07:23:18 +0000 Subject: [PATCH] Add defensive check that argument may be null in call to compareConversionFunctions() on incorrect code. I'm looking into getting a reduced test case, but it's not immediately available. Fixes llvm-svn: 205285 --- clang/lib/Sema/SemaOverload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 1dab1501296c..ee1feb5c8237 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -3278,7 +3278,7 @@ compareConversionFunctions(Sema &S, FunctionDecl *Function1, // respectively, always prefer the conversion to a function pointer, // because the function pointer is more lightweight and is more likely // to keep code working. - CXXConversionDecl *Conv1 = dyn_cast(Function1); + CXXConversionDecl *Conv1 = dyn_cast_or_null(Function1); if (!Conv1) return ImplicitConversionSequence::Indistinguishable;