[clang] [analyzer] Fix truncation of ranges wider than 64 bits (PR #239147)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 01:37:45 PST 2026


NagyDonat wrote:

> > I suppose this patch was motivated by a real-world use case, so I wonder if we should add that to the LIT tests?
> 
> Yes. We have a lit test in downstream but the feature which triggers the bug doesn't exist in the upstream.
> So for this patch, there is no lit test which could really trigger this bug. The only behavior of the usage in the current code is casting to the wider of the two operand types and never truncates so this bug would never occur. - just like I said in the desc of the PR.

I think this is completely fine, no need for a lit test.

The unit test demonstrates that the logic was incorrect and this PR fixes it; and the commit message clearly explains that actual buggy output was only observable when it was combined with (reasonable) downstream changes.


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


More information about the cfe-commits mailing list