Fixes the issue D118987 by mapping the propagation to the callsite's
LocationContext.
This way we can keep track of the in-flight propagations.
Note that empty propagation sets won't be inserted.
Paths
| Differential D119128
[analyzer] Fix taint propagation by remembering to the location context ClosedPublic Authored by steakhal on Feb 7 2022, 4:18 AM.
Details Summary Fixes the issue D118987 by mapping the propagation to the callsite's Note that empty propagation sets won't be inserted.
Diff Detail
Event TimelineHerald added subscribers: manas, dkrupp, donat.nagy and 6 others. · View Herald TranscriptFeb 7 2022, 4:18 AM steakhal added a parent revision: D118987: [analyzer] Add failing test case demonstrating buggy taint propagation. steakhal added a child revision: D119129: [analyzer] Fix taint rule of fgets and setproctitle_init.Feb 7 2022, 4:31 AM Comment Actions Sounds about right! Just a nit, otherwise LGTM.
steakhal marked an inline comment as done. Comment Actionsusing REGISTER_SET_FACTORY_WITH_PROGRAMSTATE
This revision is now accepted and ready to land.Feb 7 2022, 9:55 AM Closed by commit rGb099e1e56255: [analyzer] Fix taint propagation by remembering to the location context (authored by steakhal). · Explain WhyFeb 14 2022, 7:57 AM This revision was automatically updated to reflect the committed changes. Comment Actions I'll re-land the whole stack tomorrow, by adding the asserts requirement for the tests to make the tests pass on all bots.
Revision Contents
Diff 408424 clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
clang/test/Analysis/taint-checker-callback-order-has-definition.c
|
Are there any comfortable ways of making this non-global?
https://llvm.org/docs/CodingStandards.html#do-not-use-static-constructors
Also, I wonder how efficient immutable data structures are against something like std::vector, when the element type is small and the number of elements are expected to be very low. Just a thought, I don't have particularly strong views on this.