[clang] [Clang] [CodeGen] UBSan Trap Reasons (PR #145967)

Dan Liew via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 16:58:06 PDT 2025


================
@@ -4051,6 +4139,14 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
 
   llvm::BasicBlock *&TrapBB = TrapBBs[CheckHandlerID];
 
+  llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation();
+  llvm::StringRef TrapMessage = GetUBSanTrapForHandler(CheckHandlerID);
+
+  if (getDebugInfo()) {
----------------
delcypher wrote:

This looks wrong. If TrapMessage is empty we’ll attach a message (e.g. for the bounds safety trap) anyway.

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


More information about the cfe-commits mailing list