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

Bruno Cardoso Lopes via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 13:40:57 PST 2025


================
@@ -79,19 +81,22 @@ bool IsStackTraceSuppressed(const StackTrace *stack) {
           return true;
     }
 
-    if (suppression_ctx->HasSuppressionType(kInterceptorViaFunction)) {
-      SymbolizedStackHolder symbolized_stack(symbolizer->SymbolizePC(addr));
-      const SymbolizedStack *frames = symbolized_stack.get();
-      CHECK(frames);
-      for (const SymbolizedStack *cur = frames; cur; cur = cur->next) {
-        const char *function_name = cur->info.function;
-        if (!function_name) {
-          continue;
-        }
-        // Match "interceptor_via_fun" suppressions.
-        if (suppression_ctx->Match(function_name, kInterceptorViaFunction,
-                                   &s)) {
-          return true;
+    const char *suppressions[] = {kInterceptorViaFunction,
+                                  kAllocDeallocMismatch};
+    for (const char *suppression : suppressions) {
+      if (suppression_ctx->HasSuppressionType(suppression)) {
----------------
bcardosolopes wrote:

Nit: 
```
if (!suppression_ctx->HasSuppressionType(suppression))
  continue;
<... rest of the logic>
```

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


More information about the llvm-commits mailing list