From 8d0019a44429db0a5eb65bab798e4300db5504b4 Mon Sep 17 00:00:00 2001 From: weiyu Date: Sat, 15 Jun 2019 00:11:27 -0700 Subject: [PATCH] CallInst::getCalledFunction() may return a null function --- isAtomicCall.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/isAtomicCall.hpp b/isAtomicCall.hpp index 11e5e68..a127619 100644 --- a/isAtomicCall.hpp +++ b/isAtomicCall.hpp @@ -6,6 +6,9 @@ bool isAtomicCall(Instruction *I) { if ( auto *CI = dyn_cast(I) ) { Function *fun = CI->getCalledFunction(); + if (fun == NULL) + return false; + StringRef funName = fun->getName(); if ( (CI->isTailCall() && funName.contains("atomic_")) || -- 2.34.1