[compiler-rt] [sanitizer] Support "alloc_dealloc_mismatch" suppressions (PR #124197)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 08:02:56 PST 2025


================
@@ -732,7 +733,8 @@ struct Allocator {
     if (!AtomicallySetQuarantineFlagIfAllocated(m, ptr, stack)) return;
 
     if (m->alloc_type != alloc_type) {
-      if (atomic_load(&alloc_dealloc_mismatch, memory_order_acquire)) {
+      if (atomic_load(&alloc_dealloc_mismatch, memory_order_acquire) &&
+          !IsStackTraceSuppressed(stack)) {
----------------
andrewjcg wrote:

> Why ReportAllocTypeMismatch and not ReportNewDeleteTypeMismatch?

Yeah, I'm not super clear on the distinction between the two.

I actually think there's a bug w/ my change here -- I think I need a separate suppression check function, otherwise all the other stack-trace suppressions would match this, which isn't what we want.  Fixing now.

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


More information about the llvm-commits mailing list