[clang] [analyzer] Compute length of string literal initializers (#66990) (PR #68368)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 03:31:56 PDT 2023


https://github.com/DonatNagyE requested changes to this pull request.

As far as I see the code that you added doesn't check whether the global variable is a constant or not. Please add a check for this (examine the type of the declaration `decl`) and consider adding test cases which validate that this logic doesn't assign length values to non-constant global strings (because their actual content may be different from the string literal that was used to initialize them).

Also note that in general, the LLVM coding style uses CamelCased names for variables; however here I can accept lowerCamelCased names if you want to remain consistent with the surrounding legacy code.

https://github.com/llvm/llvm-project/pull/68368


More information about the cfe-commits mailing list