Skip to content
Merged
Changes from all 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
12 changes: 11 additions & 1 deletion lib/PhasarLLVM/DataFlow/IfdsIde/Problems/IFDSTaintAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,17 @@ IFDSTaintAnalysis::FlowFunctionPtrType
IFDSTaintAnalysis::getSummaryFlowFunction(
[[maybe_unused]] IFDSTaintAnalysis::n_t CallSite,
[[maybe_unused]] IFDSTaintAnalysis::f_t DestFun) {
// Don't use a special summary
// $sSS1poiyS2S_SStFZ is Swift's String append method
// if concat a tainted string with something else the
// result should be tainted
if (DestFun->getName().equals("$sSS1poiyS2S_SStFZ")) {
const auto *CS = llvm::cast<llvm::CallBase>(CallSite);

return generateFlowIf<d_t>(CallSite, [CS](d_t Source) {
return ((Source == CS->getArgOperand(1)) ||
(Source == CS->getArgOperand(3)));
});
}
return nullptr;
}

Expand Down