Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null checking getCalledFunction() when calling getName() #21

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ 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 (const auto * Callee = CS->getCalledFunction()) {
fabianbs96 marked this conversation as resolved.
Show resolved Hide resolved
fabianbs96 marked this conversation as resolved.
Show resolved Hide resolved
if (Callee->getName() == InitializerFn) {
return generateFromZero(SecureHeapFact::INITIALIZED);
}
}
return identityFlow();
}
Expand Down Expand Up @@ -147,7 +148,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
Loading