[PATCH] D128064: [Static Analyzer] Small array binding policy

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 30 06:13:47 PDT 2022


Szelethus added a comment.
Herald added a subscriber: steakhal.

No need for post commit fixes, just general observations since I noticed them.



================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2427
+  uint64_t ArrSize = CAT->getSize().getLimitedValue();
+  if (ArrSize > SmallArrayLimit)
+    return None;
----------------
Unless we use this a lot, it'd be better to just use `AnalyzerOptions` natively, it'd be more visible that this is directly configurable by the user.

There is no need to change this once its here, just a general design observation.


================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2466
   // Handle lazy compound values.
-  if (isa<nonloc::LazyCompoundVal>(Init))
+  if (Optional<nonloc::LazyCompoundVal> LCV =
+          Init.getAs<nonloc::LazyCompoundVal>()) {
----------------
For `SVal::getAs`, we usually use `auto` for the return value type (which has its history: D54877#inline-484319!).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128064/new/

https://reviews.llvm.org/D128064



More information about the cfe-commits mailing list