[clang-tools-extra] [NFC] Fix uninitialized data member in constructor. (PR #118324)

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 10:55:30 PST 2024


https://github.com/zahiraam updated https://github.com/llvm/llvm-project/pull/118324

>From 4142b5bd36a4f7a554196687e191a09dba9e4dcf Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat <zahira.ammarguellat at intel.com>
Date: Mon, 2 Dec 2024 09:09:21 -0800
Subject: [PATCH 1/2] [NFC] Fix uninitialized data member in constructor.

---
 clang-tools-extra/clangd/index/dex/Dex.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang-tools-extra/clangd/index/dex/Dex.h b/clang-tools-extra/clangd/index/dex/Dex.h
index 69e161d51135b6..f907c9a55b935b 100644
--- a/clang-tools-extra/clangd/index/dex/Dex.h
+++ b/clang-tools-extra/clangd/index/dex/Dex.h
@@ -58,6 +58,7 @@ class Dex : public SymbolIndex {
     KeepAlive = std::shared_ptr<void>(
         std::make_shared<Payload>(std::move(BackingData)), nullptr);
     this->BackingDataSize = BackingDataSize;
+    this->IdxContents = IndexContents::All;
   }
 
   template <typename SymbolRange, typename RefsRange, typename RelationsRange,

>From d93be0f1db9eb4cb4691c7b023bf6bccccc046d7 Mon Sep 17 00:00:00 2001
From: Zahira Ammarguellat <zahira.ammarguellat at intel.com>
Date: Mon, 2 Dec 2024 10:54:41 -0800
Subject: [PATCH 2/2] Fix uninitialized scalar field in constructor.

---
 clang-tools-extra/clangd/index/MemIndex.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang-tools-extra/clangd/index/MemIndex.h b/clang-tools-extra/clangd/index/MemIndex.h
index fba2c1a7120a2b..879d7750ac0480 100644
--- a/clang-tools-extra/clangd/index/MemIndex.h
+++ b/clang-tools-extra/clangd/index/MemIndex.h
@@ -43,6 +43,7 @@ class MemIndex : public SymbolIndex {
     KeepAlive = std::shared_ptr<void>(
         std::make_shared<Payload>(std::move(BackingData)), nullptr);
     this->BackingDataSize = BackingDataSize;
+    this->IdxContents = IndexContents::All;
   }
 
   template <typename SymbolRange, typename RefRange, typename RelationRange,



More information about the cfe-commits mailing list