|
32 | 32 | #include <memory>
|
33 | 33 | #include <utility>
|
34 | 34 |
|
35 |
| -#define DEBUG_TYPE "taint-checker" |
36 |
| - |
37 | 35 | using namespace clang;
|
38 | 36 | using namespace ento;
|
39 | 37 | using namespace taint;
|
@@ -693,13 +691,6 @@ void GenericTaintChecker::checkPostCall(const CallEvent &Call,
|
693 | 691 | if (TaintArgs.isEmpty())
|
694 | 692 | return;
|
695 | 693 |
|
696 |
| - LLVM_DEBUG(for (ArgIdxTy I |
697 |
| - : TaintArgs) { |
698 |
| - llvm::dbgs() << "PostCall<"; |
699 |
| - Call.dump(llvm::dbgs()); |
700 |
| - llvm::dbgs() << "> actually wants to taint arg index: " << I << '\n'; |
701 |
| - }); |
702 |
| - |
703 | 694 | for (ArgIdxTy ArgNum : TaintArgs) {
|
704 | 695 | // Special handling for the tainted return value.
|
705 | 696 | if (ArgNum == ReturnValueIndex) {
|
@@ -777,25 +768,15 @@ void GenericTaintRule::process(const GenericTaintChecker &Checker,
|
777 | 768 |
|
778 | 769 | /// Propagate taint where it is necessary.
|
779 | 770 | ForEachCallArg(
|
780 |
| - [this, &State, WouldEscape, &Call](ArgIdxTy I, const Expr *E, SVal V) { |
781 |
| - if (PropDstArgs.contains(I)) { |
782 |
| - LLVM_DEBUG(llvm::dbgs() << "PreCall<"; Call.dump(llvm::dbgs()); |
783 |
| - llvm::dbgs() |
784 |
| - << "> prepares tainting arg index: " << I << '\n';); |
| 771 | + [this, &State, WouldEscape](ArgIdxTy I, const Expr *E, SVal V) { |
| 772 | + if (PropDstArgs.contains(I)) |
785 | 773 | State = State->add<TaintArgsOnPostVisit>(I);
|
786 |
| - } |
787 | 774 |
|
788 | 775 | // TODO: We should traverse all reachable memory regions via the
|
789 | 776 | // escaping parameter. Instead of doing that we simply mark only the
|
790 | 777 | // referred memory region as tainted.
|
791 |
| - if (WouldEscape(V, E->getType())) { |
792 |
| - LLVM_DEBUG(if (!State->contains<TaintArgsOnPostVisit>(I)) { |
793 |
| - llvm::dbgs() << "PreCall<"; |
794 |
| - Call.dump(llvm::dbgs()); |
795 |
| - llvm::dbgs() << "> prepares tainting arg index: " << I << '\n'; |
796 |
| - }); |
| 778 | + if (WouldEscape(V, E->getType())) |
797 | 779 | State = State->add<TaintArgsOnPostVisit>(I);
|
798 |
| - } |
799 | 780 | });
|
800 | 781 |
|
801 | 782 | C.addTransition(State);
|
|
0 commit comments