[llvm] [NFC] Fix memory leak in ConstantsTest (PR #170789)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 4 17:29:31 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

Leak introduced with #<!-- -->164381.


---
Full diff: https://github.com/llvm/llvm-project/pull/170789.diff


1 Files Affected:

- (modified) llvm/unittests/IR/ConstantsTest.cpp (+1) 


``````````diff
diff --git a/llvm/unittests/IR/ConstantsTest.cpp b/llvm/unittests/IR/ConstantsTest.cpp
index 86fd6a398cc97..5b845865f9437 100644
--- a/llvm/unittests/IR/ConstantsTest.cpp
+++ b/llvm/unittests/IR/ConstantsTest.cpp
@@ -862,6 +862,7 @@ TEST(ConstantsTest, Float128Test) {
   uint64_t r[1] = {0x0000000000003c00}; //+1
   LLVMValueRef val7 = LLVMConstFPFromBits(TyHalf, r);
   EXPECT_TRUE(val7 != nullptr);
+  LLVMDisposeBuilder(Builder);
   LLVMContextDispose(C);
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list