[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:06 PDT 2025


================
@@ -396,27 +394,30 @@ class DistinctAttributeUniquer {
                                               Attribute referencedAttr);
 };
 
-/// An allocator for distinct attribute storage instances. It uses thread local
-/// bump pointer allocators stored in a thread local cache to ensure the storage
-/// is freed after the destruction of the distinct attribute allocator.
-class DistinctAttributeAllocator {
+/// An allocator for distinct attribute storage instances. Uses a synchronized
+/// BumpPtrAllocator to ensure allocated storage is deleted when the
+/// DistinctAttributeAllocator is destroyed
----------------
gysit wrote:

```suggestion
/// An allocator for distinct attribute storage instances. Uses a synchronized
/// BumpPtrAllocator to ensure thread-safety. The allocated storage is deleted when the
/// DistinctAttributeAllocator is destroyed.
```
nit: I would probably split the sentence?

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


More information about the Mlir-commits mailing list