]> granicus.if.org Git - clang/commitdiff
Add defensive check that argument may be null in call to compareConversionFunctions...
authorTed Kremenek <kremenek@apple.com>
Tue, 1 Apr 2014 07:23:18 +0000 (07:23 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 1 Apr 2014 07:23:18 +0000 (07:23 +0000)
I'm looking into getting a reduced test case, but it's not
immediately available.

Fixes <rdar://problem/16344806>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205285 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp

index 1dab1501296caab2d94d9e1cc9d390b5cd19162e..ee1feb5c82375ef89005a2b3bbe2b70ae9d263a5 100644 (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;