[Mlir-commits] [mlir] [MLIR] Fix use-after-frees when accessing DistinctAttr storage (PR #148666)
Tobias Gysi
llvmlistbot at llvm.org
Tue Jul 15 04:21:07 PDT 2025
================
@@ -0,0 +1,46 @@
+//===- DistinctAttributeAllocatorTest.cpp - DistinctAttr storage alloc test
+//-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===-----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "mlir/IR/Builders.h"
+#include "mlir/IR/BuiltinAttributes.h"
+#include "mlir/IR/MLIRContext.h"
+#include "llvm/Support/CrashRecoveryContext.h"
+#include <thread>
+
+using namespace mlir;
+
+//
+// Test that a DistinctAttr that is created on a separate thread does
+// not have its storage deleted when the thread joins
+//
----------------
gysit wrote:
```suggestion
// Test that a DistinctAttr that is created on a separate thread does
// not have its storage deleted when the thread joins.
```
nit: missing dot
https://github.com/llvm/llvm-project/pull/148666
More information about the Mlir-commits
mailing list