-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang][UBSan] Make sure that the implicit-conversion group is compatible with minimal runtime #114865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang][UBSan] Make sure that the implicit-conversion group is compatible with minimal runtime #114865
Conversation
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Axel Lundberg (Zonotora) ChangesWe are currently getting:
when running
because Full diff: https://github.com/llvm/llvm-project/pull/114865.diff 1 Files Affected:
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 |
|
Hi @zygoloid and @efriedma-quic, would you mind taking a look? Thanks! |
@vitalybuka This is connected to #75481 that was merged a couple of months ago.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you also add a test that we allow combining -fsanitize=implicit-conversion
and -fsanitize-minimal-runtime
so that this doesn't regress in a similar way in future?
(It'd be great if the test covered all the sanitizer groups that are currently compatible with the minimal runtime, so we get an early warning if we add any non-compatible sanitizers to those groups, but at minimum I'd like to see some test coverage for this change.)
Will do |
…ible with minimal runtime
9cb9672
to
5630203
Compare
@zygoloid I don't have write access, please merge on my behalf! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/195/builds/1335 Here is the relevant piece of the build log for the reference
|
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 includesimplicit-bitfield-conversion
which is not included in theinteger
check. Theinteger
check includes theimplicit-integer-conversion
checks and is supported by the trapping option and because of that compatible with the minimal runtime. It is thus reasonable to makeimplicit-bitfield-conversion
compatible with the minimal runtime.