[PATCH] D86743: [analyzer] Ignore VLASizeChecker case that could cause crash

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 05:53:16 PDT 2020


balazske added a comment.

The fix is probably OK but I could not find out what causes the problem in this case and not in other (similar) ones.
Why is not possible to assume `SVB.evalEQ(State, DynSize, *ArraySizeNL)` to true:
DynSize: `extent_$1{e}`
*ArraySizeNL: `8 U64b`
The problem occurs likely not at the first iteration of the loop. Probably something is "messed up" in the state.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp:304
+    // See https://bugs.llvm.org/show_bug.cgi?id=47272.
+    if (!State)
+      return;
----------------
If the previous assumption fails the assumptions made before it (about size of array dimensions) can be applied. Like at line 284 a transition should be added. At least if the current state indicates not a problem that makes this unnecessary.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86743



More information about the cfe-commits mailing list