projects
/
c11llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d0c694
)
CallInst::getCalledFunction() may return a null function
author
weiyu
<weiyuluo1232@gmail.com>
Sat, 15 Jun 2019 07:11:27 +0000
(
00:11
-0700)
committer
weiyu
<weiyuluo1232@gmail.com>
Sat, 15 Jun 2019 07:11:27 +0000
(
00:11
-0700)
isAtomicCall.hpp
patch
|
blob
|
history
diff --git
a/isAtomicCall.hpp
b/isAtomicCall.hpp
index 11e5e68b77ee25a02d8a84ac4e39f7280d220b2f..a12761964986dd76fa2483af5bf6a3f31d397eb0 100644
(file)
--- a/
isAtomicCall.hpp
+++ b/
isAtomicCall.hpp
@@
-6,6
+6,9
@@
bool isAtomicCall(Instruction *I)
{
if ( auto *CI = dyn_cast<CallInst>(I) ) {
Function *fun = CI->getCalledFunction();
{
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_")) ||
StringRef funName = fun->getName();
if ( (CI->isTailCall() && funName.contains("atomic_")) ||