This is a bugfix. Simply put, 2u - 1u != 2u - 1u. See the static
assertion in the test file. The fix simply ban the negation of unsigned
expressions. This way the we are getting a little bit more conservatie,
but at least we do not infer wrong values.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Seems reasonable.
clang/test/Analysis/constraint_manager_negate_difference.c | ||
---|---|---|
145–148 | It's not immediately clear what you refer to by the TRUE case. The two evals the opposite condition, consequently one of them should be FALSE. Same for the next case. |
clang/test/Analysis/constraint_manager_negate_difference.c | ||
---|---|---|
125–130 | Actually, this test case was correct, because UINT_MID is a special value and for that _Static_assert(UINT_MID == -UINT_MID, ""); holds. |
Actually, this test case was correct, because UINT_MID is a special value and for that
holds.
So, this patch is meaningless.