[llvm] [CodeGenTypes] Prevent potential multiplication overflow in `getSizeInBits` (PR #224658)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 02:10:01 PDT 2026


https://github.com/aengelke commented:

Do we have a policy indicating that we fix things found by static analyzers even if can never happen? If not, I don't think we should do this. We downcast the type size to unsigned in so many places that even if this would fix a bug, there would be many others. Types >= 2**32 bits (practically even smaller sizes) are also broken in many other dimensions.

So really, this only makes the code harder to read.

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


More information about the llvm-commits mailing list