[clang] Sanitizer: Support -fwrapv with -fsanitize=signed-integer-overflow (PR #82432)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 14:38:45 PST 2024


================
@@ -723,7 +723,9 @@ class ScalarExprEmitter
     if (Ops.Ty->isSignedIntegerOrEnumerationType()) {
       switch (CGF.getLangOpts().getSignedOverflowBehavior()) {
       case LangOptions::SOB_Defined:
-        return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul");
+        if (!CGF.SanOpts.has(SanitizerKind::SignedIntegerOverflow))
----------------
vitalybuka wrote:

not the same

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


More information about the cfe-commits mailing list