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

Igor Wodiany via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 02:25:09 PDT 2026


IgWod wrote:

> Do we have a policy indicating that we fix things found by static analyzers even if can never happen?

I don't think there is any policy but I'm happy to be corrected.

For more context, the CodeQL analysis reported around 100 issues related to the multiplication overflow in the `llvm` directory. I rejected most of them as they could never happen based on the context or could only happen in some very pathological cases. I filed a handful for PR for cases that either could be potential bugs or I was not familiar with the code to confidently rejected them (as in this case).

Do I understand correctly this overflow wouldn't happen in practice since it would require types sizes that LLVM doesn't/cannot support today? If so, I'm happy to abandon the PR and dismiss the alert on my side.

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


More information about the llvm-commits mailing list