[Mlir-commits] [mlir] [acc] Fix OpenACCUtilsTest to avoid leak in isDeviceValueNonMappableType (PR #176269)
Razvan Lupusoru
llvmlistbot at llvm.org
Thu Jan 15 15:36:20 PST 2026
https://github.com/razvanlupusoru created https://github.com/llvm/llvm-project/pull/176269
The problem is that the operation is created without an owner, then there is no free. This is being caught in llvm buildbot that are testing sanitizers.
>From c1cbc4308474e986af8a4f9ce1ef3eb9a6c8e6ae Mon Sep 17 00:00:00 2001
From: Razvan Lupusoru <rlupusoru at nvidia.com>
Date: Thu, 15 Jan 2026 15:34:46 -0800
Subject: [PATCH] [acc] Fix OpenACCUtilsTest to avoid leak in
isDeviceValueNonMappableType
The problem is that the operation is created without an owner,
then there is no free. This is being caught in llvm buildbot
that are testing sanitizers.
---
mlir/unittests/Dialect/OpenACC/OpenACCUtilsTest.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mlir/unittests/Dialect/OpenACC/OpenACCUtilsTest.cpp b/mlir/unittests/Dialect/OpenACC/OpenACCUtilsTest.cpp
index 29186ce826d1b..56cc2b9d9ba0b 100644
--- a/mlir/unittests/Dialect/OpenACC/OpenACCUtilsTest.cpp
+++ b/mlir/unittests/Dialect/OpenACC/OpenACCUtilsTest.cpp
@@ -1435,8 +1435,9 @@ TEST_F(OpenACCUtilsTest, isDeviceValueMemrefNoAddressSpace) {
TEST_F(OpenACCUtilsTest, isDeviceValueNonMappableType) {
// Test with a non-mappable type (i32 value)
- auto constOp = arith::ConstantOp::create(b, loc, b.getI32IntegerAttr(42));
- Value val = constOp.getResult();
+ OwningOpRef<arith::ConstantOp> constOp =
+ arith::ConstantOp::create(b, loc, b.getI32IntegerAttr(42));
+ Value val = constOp->getResult();
// Should return false since i32 is not a MappableType or PointerLikeType
EXPECT_FALSE(isDeviceValue(val));
More information about the Mlir-commits
mailing list