[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 11:01:08 PDT 2025


================
@@ -2817,7 +2817,9 @@ void CodeGenFunction::EmitVTablePtrCheckForCall(const CXXRecordDecl *RD,
     RD = LeastDerivedClassWithSameLayout(RD);
 
   auto [Ordinal, _] = SanitizerInfoFromCFICheckKind(TCK);
-  ApplyDebugLocation ApplyTrapDI(*this, SanitizerAnnotateDebugInfo(Ordinal));
+  ApplyDebugLocation ApplyTrapDI(
----------------
thurstond wrote:

I checked again and found that all callers to EmitVTablePtrCheck (EmitVTablePtrCheckForCall, EmitVTablePtrCheckForCast) establish SanitizerDebugLocation. Hence, we don't need nested SanitizerDebugLocation; instead, I removed SanitizerDebugLocation from EmitVTablePtrCheck: https://github.com/llvm/llvm-project/pull/141997/commits/aead894277f56e16bb63b5f9e40b6e6dfcebb01a

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


More information about the cfe-commits mailing list