Skip to content

Commit

Permalink
Fix IFDSTaintLibSummary SeqFault if find doesn't find anything (#737)
Browse files Browse the repository at this point in the history
* fix

* fixed formatting
  • Loading branch information
mxHuber authored Oct 23, 2024
1 parent bb86c25 commit 96f0758
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/PhasarLLVM/DataFlow/IfdsIde/Problems/IFDSTaintAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,14 @@ auto IFDSTaintAnalysis::getSummaryFlowFunction([[maybe_unused]] n_t CallSite,
llvm::zip(CS->args(), DestFun->args())) {
if (Source == Arg.get()) {
auto VecFacts = DestFunFacts.find(DestParam.getArgNo());
for (const auto &VecFact : VecFacts->second) {
if (const auto *Param =
std::get_if<library_summary::Parameter>(&VecFact.Fact)) {
Facts.insert(CS->getArgOperand(Param->Index));
} else {
Facts.insert(CallSite);
if (VecFacts != DestFunFacts.end()) {
for (const auto &VecFact : VecFacts->second) {
if (const auto *Param = std::get_if<library_summary::Parameter>(
&VecFact.Fact)) {
Facts.insert(CS->getArgOperand(Param->Index));
} else {
Facts.insert(CallSite);
}
}
}
}
Expand Down

0 comments on commit 96f0758

Please sign in to comment.