Check the size constraints for every (variable) dimension of the array.
Try to compute array size by multiplying size for every dimension.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It would be great to see a test about properly setting the arrays extent. Otherwise LGTM.
clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp | ||
---|---|---|
61 | Hmm, why would we? The size is most probably unknown to us. | |
161–179 | Ahaa, so if we have a vla[x][y][a][b] variable, VLALast would be vla[x], which allows you to get the actual element type. Could you explain that (maybe even with a small example like this) in the code? | |
200–202 | How about We were not able to determine extent of the array, return with the original state. |
LGTM, thanks! I'm not terribly knowledgable about VLAs, if someone else would gave a green light it would be even better.
Hmm, why would we? The size is most probably unknown to us.