[clang] [Clang] Fix constexpr __builtin_(add|sub|mul)_overflow bugs (PR #192568)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 22 06:43:59 PDT 2026


================
@@ -136,6 +136,8 @@ static void assignInteger(InterpState &S, const Pointer &Dest, PrimType ValueT,
     Dest.deref<IntegralAP<false>>() =
         S.allocAP<IntegralAP<false>>(Value.getBitWidth());
     Dest.deref<IntegralAP<false>>().copy(Value);
+  } else if (ValueT == PT_Bool) {
+    Dest.deref<Boolean>() = Boolean::from(!Value.isZero());
----------------
tbaederr wrote:

I generally agree but I don't think it's worth it in this file. I'd rename the function to `assignIntegral` at best.

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


More information about the cfe-commits mailing list