[clang] [analyzer] Fix BuiltingFunctionChecker crash on large types (PR #174335)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 5 02:38:57 PST 2026
steakhal wrote:
> Oh, I thought that APInt supports big integers, but apparently it does not... Thanks for fixing this!
APInt supports big integers. It's that we would need to pass a QualType for the evalBinOp APIs, and previously we just picked the next large enough primitive type, such as 32, 64, 128 bit wide integral type. However, when `__int128_t` was the parameter, then it could not find one primitive type with 256 bits, thus failed. Similar goes for non-power-of-2 bitwidths. There was no good match for them.
In this patch, I simply sidestep this one by using BigInts, which provide arbitrary precision. Remember, this is only used for checking if wrapping happens.
https://github.com/llvm/llvm-project/pull/174335
More information about the cfe-commits
mailing list