[PATCH] D64272: [analyzer] Note last writes to a condition only in a nested stackframe

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 00:16:10 PDT 2019

Szelethus marked 2 inline comments as done.
Szelethus added inline comments.

Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1447-1454
   // If we have an expression that provided the value, try to track where it
   // came from.
   if (InitE) {
     if (!IsParam)
       InitE = InitE->IgnoreParenCasts();
     trackExpressionValue(StoreSite, InitE, BR, EnableNullFPSuppression, TKind);
NoQ wrote:
> Yeah, interesting, i guess we should also not track the value further. Otherwise it'd be weird that one piece in the middle is missing but everything else is still there.
That is what D64271 was for, and I think it would be a bad idea. What we should rather do is have a better note message:
"The value of 'flag' will be used in a condition expression later" or something like that.

Comment at: clang/test/Analysis/track-control-dependency-conditions.cpp:263
 void foo() {
   flag = getInt(); // tracking-note{{Value assigned to 'flag'}}
Like here. We'd lose this note if we didn't track further. I'm already gathering data tho!



More information about the cfe-commits mailing list