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 <rdar://problem/16344806>

llvm-svn: 205285
This commit is contained in:
Ted Kremenek 2014-04-01 07:23:18 +00:00
parent e081e22036
commit 8d265c2633
1 changed files with 1 additions and 1 deletions

View File

@ -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<CXXConversionDecl>(Function1);
CXXConversionDecl *Conv1 = dyn_cast_or_null<CXXConversionDecl>(Function1);
if (!Conv1)
return ImplicitConversionSequence::Indistinguishable;