TaintBugVisitor is a universal visitor, and many checkers rely on it, such as ArrayBoundCheckerV2.cpp, DivZeroChecker.cpp and VLASizeChecker.cpp. Moving TaintBugVisitor to BugReporterVisitors.h enables other checker can also track where tainted value came from.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
I'm new to the taint visitor, but I am quite confused by your change description.
and many checkers rely on it
How can other checkers rely on it if it's private to the taint checker?
Also, it's probably to explicitly include BugReporterVisitors.h in the checker file then.
Thanks for your review, george! TaintBugVisitor is an utility to add extra information to illustrate where the taint information originated from. There are several checkers use taint information, e.g. ArrayBoundCheckerV2.cpp, in some cases it will report a warning, like warning: Out of bound memory access (index is tainted). If TaintBugVisitor moves to BugReporterVisitors.h, ArrayBoundCheckerV2 can add extra notes like Taint originated here to the report by adding TaintBugVisitor.
Also, it's probably to explicitly include BugReporterVisitors.h in the checker file then.
If these checkers want to add Taint originated here using TaintBugVisitor, it is necessary to explicitly include BugReporterVisitors.h in following patch.
can add extra notes like
Ah right, than it's "can rely on" rather than "rely on".
it is necessary to explicitly include
I've meant adding the include to GenericTaintChecker.cpp.
LGTM otherwise.