CallInst::getCalledFunction() may return a null function
authorweiyu <weiyuluo1232@gmail.com>
Sat, 15 Jun 2019 07:11:27 +0000 (00:11 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Sat, 15 Jun 2019 07:11:27 +0000 (00:11 -0700)
isAtomicCall.hpp

index 11e5e68..a127619 100644 (file)
@@ -6,6 +6,9 @@ bool isAtomicCall(Instruction *I)
 {
        if ( auto *CI = dyn_cast<CallInst>(I) ) {
                Function *fun = CI->getCalledFunction();
+               if (fun == NULL)
+                       return false;
+
                StringRef funName = fun->getName();
 
                if ( (CI->isTailCall() && funName.contains("atomic_")) ||