[PATCH] D68162: [analyzer][MallocChecker][NFC] Communicate the allocation family to auxiliary functions with parameters
Balogh, Ádám via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 3 09:00:12 PDT 2019
baloghadamsoftware added a comment.
I like this change. If we can retrieve something with a simple getter, then do not carry extra parameters all over the code. However, if we have to recalculate something over and over again then it is much better to determine it once and pass it around as a parameter. Especially in this case where we have the information statically at top level and do not have to calculate it all if we use that.
================
Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1860
+ // that.
+ assert(!RsBase || (RsBase && RsBase->getAllocationFamily() == Family));
+
----------------
Please add an `&& "<Error message>"` to the assertion.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68162/new/
https://reviews.llvm.org/D68162
More information about the cfe-commits
mailing list