Skip to content

Commit

Permalink
Null checking getCalledFunction() when calling getName()
Browse files Browse the repository at this point in the history
  • Loading branch information
SanthoshMohan97 committed Oct 31, 2023
1 parent 9179cf0 commit 8c8906d
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ IDESecureHeapPropagation::getCallToRetFlowFunction(
// Change to CallSite everywhere
const auto *CS = llvm::cast<llvm::CallBase>(CallSite);

auto FName = CS->getCalledFunction()->getName();
if (FName == InitializerFn) {
return generateFromZero(SecureHeapFact::INITIALIZED);
if (CS->getCalledFunction()) {
auto FName = CS->getCalledFunction()->getName();
if (FName == InitializerFn) {
return generateFromZero(SecureHeapFact::INITIALIZED);
}
}
return identityFlow();
}
Expand Down Expand Up @@ -147,7 +149,7 @@ IDESecureHeapPropagation::getCallToRetEdgeFunction(
return SHPGenEdgeFn{l_t::INITIALIZED};
}
const auto *CS = llvm::cast<llvm::CallBase>(CallSite);
if (CallNode != ZeroValue &&
if (CallNode != ZeroValue && CS->getCalledFunction() &&
CS->getCalledFunction()->getName() == ShutdownFn) {
// std::cerr << "Kill at " << llvmIRToShortString(callSite) << std::endl;
return SHPGenEdgeFn{l_t::BOT};
Expand Down

0 comments on commit 8c8906d

Please sign in to comment.