Skip to content

Commit a3cd0e4

Browse files
committed
Fix source functions in TaintConfig
1 parent 1c4e3cb commit a3cd0e4

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

lib/PhasarLLVM/TaintConfig/TaintConfig.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,15 @@ void TaintConfig::forAllGeneratedValuesAt(
385385
Handler(Inst->getOperand(Arg.getArgNo()));
386386
}
387387
}
388-
}
389-
390-
for (const auto *Op : Inst->operand_values()) {
391-
if (SourceValues.count(Op)) {
392-
Handler(Op);
388+
} else {
389+
/// If we have a call to a source function, we would generate via formal
390+
/// parameter instead via actual argument.
391+
/// If any function is called with a variable that was defined as source, we
392+
/// don't want to re-generate the value.
393+
for (const auto *Op : Inst->operand_values()) {
394+
if (SourceValues.count(Op)) {
395+
Handler(Op);
396+
}
393397
}
394398
}
395399

0 commit comments

Comments
 (0)