[√] I have searched open and closed issues for duplicates
[√] I made sure that I am not using an old project version (DO: pull Phasar, update git submodules, rebuild the project and check if the bug is still there)
If a taint seed is a argument of one function, it will be attached to the entry instructon of that function. The following is the code of taint seeds initialization.
std::map<const llvm::Instruction *, std::set<const llvm::Value *>>
LLVMTaintConfig::makeInitialSeedsImpl() const {
std::map<const llvm::Instruction *, std::set<const llvm::Value *>>
InitialSeeds;
for (const auto *SourceValue : SourceValues) {
if (const auto *Inst = llvm::dyn_cast<llvm::Instruction>(SourceValue)) {
InitialSeeds[Inst].insert(Inst);
} else if (const auto *Arg = llvm::dyn_cast<llvm::Argument>(SourceValue);
Arg && !Arg->getParent()->isDeclaration()) {
const auto *FunFirstInst = &Arg->getParent()->getEntryBlock().front();
InitialSeeds[FunFirstInst].insert(Arg);
}
}
return InitialSeeds;
}
However, when the exploed spuer graph is construted and comes to the DFA Phase II, in the valueComputationTask,
The lmplementation of getStartPointsOf in for (n_t SP : ICF->getStartPointsOf(ICF->getFunctionOf(n))) is:
std::set<const llvm::Instruction *>
LLVMBasedCFG::getStartPointsOf(const llvm::Function *Fun) const {
if (!Fun) {
return {};
}
if (!Fun->isDeclaration()) {
const auto *EntryInst = &Fun->front().front();
if (IgnoreDbgInstructions && llvm::isa<llvm::DbgInfoIntrinsic>(EntryInst)) {
return {EntryInst->getNextNonDebugInstruction(
false /*Only debug instructions*/)};
}
return {EntryInst};
}
PHASAR_LOG_LEVEL(DEBUG, "Could not get starting points of '"
<< Fun->getName()
<< "' because it is a declaration");
return {};
}
This funciton will return the first no debug entry instruciton.
Which mean, when a taint seed is the parament of a function and the entry instructon of that function is a debug instruction, the result table will record it as bottom however the valueComputationTask will calculate from the first no debug instruction. Will casue the problem illustrate in the beginning.
The taint fact value has some mistakes in the no call instruction:
If a taint seed is a argument of one function, it will be attached to the entry instructon of that function. The following is the code of taint seeds initialization.
However, when the exploed spuer graph is construted and comes to the DFA Phase II, in the valueComputationTask,
The lmplementation of
getStartPointsOf
infor (n_t SP : ICF->getStartPointsOf(ICF->getFunctionOf(n)))
is:This funciton will return the first no debug entry instruciton.
Which mean, when a taint seed is the parament of a function and the entry instructon of that function is a debug instruction, the result table will record it as bottom however the
valueComputationTask
will calculate from the first no debug instruction. Will casue the problem illustrate in the beginning.