[clang] [analyzer] Fix _Atomic crashes for Z3 symbolic execution (PR #212050)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 26 03:33:21 PDT 2026


================
@@ -270,8 +274,14 @@ class SMTConv {
                                           QualType ToTy, uint64_t ToBitWidth,
                                           QualType FromTy,
                                           uint64_t FromBitWidth) {
-    if ((FromTy.getAtomicUnqualifiedType()->isIntegralOrEnumerationType() &&
-         ToTy.getAtomicUnqualifiedType()->isIntegralOrEnumerationType()) ||
+    FromTy = getSymbolicValueType(FromTy);
+    ToTy = getSymbolicValueType(ToTy);
+
+    if (FromTy == ToTy && FromBitWidth == ToBitWidth)
+      return Exp;
----------------
steakhal wrote:

Is this the only place we need this sort of type canonicalization? How did you ensure that this fix is complete, and not just partial?

Why do we need the `FromTy == ToTy && FromBitWidth == ToBitWidth` early return?

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


More information about the cfe-commits mailing list