[PATCH] D77305: [Analyzer][VLASize] Support multi-dimensional arrays.

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 8 08:39:47 PDT 2020


martong accepted this revision.
martong added a comment.

LGTM, nice work!



================
Comment at: clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp:163
+  // Walk over the VLAs for every dimension until a non-VLA is found.
+  // Collect the sizes, put the most inner VLA to `VLALast`.
+  // In "vla[x][2][y][3]" this will be the array for index "y".
----------------
I'd mention that we collect the sizes into `SizeExpr`. And perhaps that is not the best name in this sense, maybe `VarLenSizeExprs` would be more expressive.


================
Comment at: clang/test/Analysis/vla.c:110
+
+void check_VLA_extent() {
+  int x = 3;
----------------
Great to have these tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77305





More information about the cfe-commits mailing list