[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 1 08:32:27 PDT 2021


martong added a comment.

@ASDenysPetrov This looks promising! Please address the nits which @steakhal found, than I think it is good to land.



================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1641
+  // FIXME: Take array dimension into account to prevent exceeding its size.
+  const int64_t I = Idx.getExtValue();
+  uint32_t Code =
----------------
steakhal wrote:
> You could use the `uint64_t` type here, and spare the subsequent explicit cast. This operation would be safe since `Idx` must be non-negative here.
+1 for using `uint64_t` if possible


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

https://reviews.llvm.org/D107339



More information about the cfe-commits mailing list