[clang] [clang][UBSan] Make sure that the implicit-conversion group is compatible with minimal runtime (PR #114865)

Axel Lundberg via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 12:26:55 PST 2024


https://github.com/Zonotora created https://github.com/llvm/llvm-project/pull/114865

We are currently getting:

`clang: error: invalid argument '-fsanitize-minimal-runtime' not allowed with '-fsanitize=implicit-conversion'`

when running

`-fsanitize=implicit-conversion -fsanitize-minimal-runtime`

because `implicit-conversion` now includes `implicit-bitfield-conversion` which is not included in the `integer` check. The `integer` check includes the `implicit-integer-conversion` checks and is supported by the trapping option and because of that compatible with the minimal runtime. It is thus reasonable to make `implicit-bitfield-conversion` compatible with the minimal runtime.

>From 9cb9672452295a598b7b592cf4dc8dc4478202a0 Mon Sep 17 00:00:00 2001
From: Zonotora <zonotora at hotmail.com>
Date: Mon, 4 Nov 2024 16:40:59 +0100
Subject: [PATCH] [clang][UBSan] Make sure that the implicit-conversion group
 is compatible with minimal runtime

---
 clang/lib/Driver/SanitizerArgs.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/lib/Driver/SanitizerArgs.cpp b/clang/lib/Driver/SanitizerArgs.cpp
index 89f1215afd0c81..6a00d99ba03428 100644
--- a/clang/lib/Driver/SanitizerArgs.cpp
+++ b/clang/lib/Driver/SanitizerArgs.cpp
@@ -68,9 +68,9 @@ static const SanitizerMask AlwaysRecoverable = SanitizerKind::KernelAddress |
 static const SanitizerMask NeedsLTO = SanitizerKind::CFI;
 static const SanitizerMask TrappingSupported =
     (SanitizerKind::Undefined & ~SanitizerKind::Vptr) | SanitizerKind::Integer |
-    SanitizerKind::Nullability | SanitizerKind::LocalBounds |
-    SanitizerKind::CFI | SanitizerKind::FloatDivideByZero |
-    SanitizerKind::ObjCCast;
+    SanitizerKind::ImplicitConversion | SanitizerKind::Nullability |
+    SanitizerKind::LocalBounds | SanitizerKind::CFI |
+    SanitizerKind::FloatDivideByZero | SanitizerKind::ObjCCast;
 static const SanitizerMask TrappingDefault = SanitizerKind::CFI;
 static const SanitizerMask CFIClasses =
     SanitizerKind::CFIVCall | SanitizerKind::CFINVCall |



More information about the cfe-commits mailing list