martong added inline comments.

================
Comment at: clang/test/Analysis/vla.c:107
+  if (x == BIGINDEX) {
+    size_t s = sizeof(int[x][x][x][x]); // expected-warning{{Declared 
variable-length array (VLA) has too large size}}
+    return s;
----------------
I think we could make the arithmetic more clear here:
x = BIGINDEX 65536 (2^16) and `char[x][x][x][x]` would be the first to overflow.
And `char[x][x][x][x-1]` should not overflow.

And if we are at it, then `size_t`'s range is target dependent, so I think we 
must extend the `RUN` line with `-target`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79330



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to