[llvm] [IR2Vec] Refactor vocabulary to use section-based storage (PR #158376)

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 09:27:20 PDT 2025


================
@@ -304,7 +304,7 @@ class IR2VecTestFixture : public ::testing::Test {
   Instruction *RetInst = nullptr;
 
   void SetUp() override {
-    V = Vocabulary(Vocabulary::createDummyVocabForTest(2));
+    V = new Vocabulary(Vocabulary::createDummyVocabForTest(2));
----------------
alinas wrote:

Pinging for the leak introduced here:

```
=================================================================
==5504==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 320 byte(s) in 8 object(s) allocated from:
    #0 0x55d42608af1d in operator new(unsigned long) third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:109:35
    #1 0x7fba8324bd3b in (anonymous namespace)::IR2VecTestFixture::SetUp() third_party/llvm/llvm-project/llvm/unittests/Analysis/IR2VecTest.cpp:307:9
```

V is never freed.

Can you please fix or revert?

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


More information about the llvm-commits mailing list