[clang] [ubsan] Add more -fsanitize-annotate-debug-info checks (PR #141997)

Thurston Dang via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 3 12:11:29 PDT 2025


================
@@ -1134,18 +1136,32 @@ void ScalarExprEmitter::EmitIntegerTruncationCheck(Value *Src, QualType SrcType,
       (!SrcSigned && DstSigned))
     return;
 
-  CodeGenFunction::SanitizerScope SanScope(&CGF);
-
   std::pair<ScalarExprEmitter::ImplicitConversionCheckKind,
             std::pair<llvm::Value *, SanitizerKind::SanitizerOrdinal>>
-      Check =
-          EmitIntegerTruncationCheckHelper(Src, SrcType, Dst, DstType, Builder);
-  // If the comparison result is 'i1 false', then the truncation was lossy.
+      Check;
+
+  auto CheckHandler = SanitizerHandler::ImplicitConversion;
+  {
+    // We don't know the check kind until we call
----------------
thurstond wrote:

It's a bit complicated though, so I'll leave it for followup work

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


More information about the cfe-commits mailing list