[Lldb-commits] [clang] [lldb] [UBSan][BoundsSafety] Implement support for more expressive "trap reasons" (PR #154618)

Dan Liew via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 26 10:33:52 PDT 2025


================
@@ -1839,19 +1842,43 @@ void ScalarExprEmitter::EmitBinOpCheck(
       StaticData.push_back(CGF.EmitCheckTypeDescriptor(Info.Ty));
     } else {
       // Arithmetic overflow (+, -, *).
+      int ArithOverflowKind = 0;
       switch (Opcode) {
-      case BO_Add: Check = SanitizerHandler::AddOverflow; break;
-      case BO_Sub: Check = SanitizerHandler::SubOverflow; break;
-      case BO_Mul: Check = SanitizerHandler::MulOverflow; break;
-      default: llvm_unreachable("unexpected opcode for bin op check");
+      case BO_Add: {
+        ArithOverflowKind = diag::UBSanArithKind::Add;
----------------
delcypher wrote:

Oops. Thanks for catching that.

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


More information about the lldb-commits mailing list