[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.
Denys Petrov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 26 02:32:28 PDT 2021
ASDenysPetrov added a comment.
@martong (inline)
================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1757-1760
+ // FIXME: Nevertheless, we can't do the same for cases, like:
+ // const char *str = "123"; // literal length is 4
+ // char c = str[41]; // offset is 41
+ // It should be properly handled before reaching this point.
----------------
ASDenysPetrov wrote:
> martong wrote:
> > Thanks for updating the patch! However, this `FIXME` makes me worried. Do you think you could pass the `Decl` itself to `getSValFromInitListExpr` in order to be able to check whether the type is a pointer or an array?
> This worried me as well. Currently I can't find a way to get the `Decl` for `SL`.
>
We can load this as is for now with mentioning the known issue.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107339/new/
https://reviews.llvm.org/D107339
More information about the cfe-commits
mailing list