[llvm] Fix missing `consumeError` which raise error with asserts enabled (PR #116480)

via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 16 01:15:32 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: Romain Thomas (romainthomas)

<details>
<summary>Changes</summary>

As mentioned in the title, the missing `consumeError` trigger assertions 

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


1 Files Affected:

- (modified) llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp (+6-2) 


``````````diff
diff --git a/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp b/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
index 463b9ebe3cbff5..95b95a5bbc509f 100644
--- a/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
@@ -388,12 +388,16 @@ SymbolCache::findPublicSymbolBySectOffset(uint32_t Sect, uint32_t Offset) {
     return getSymbolById(Iter->second);
 
   auto Publics = Session.getPDBFile().getPDBPublicsStream();
-  if (!Publics)
+  if (!Publics) {
+    consumeError(Publics.takeError());
     return nullptr;
+  }
 
   auto ExpectedSyms = Session.getPDBFile().getPDBSymbolStream();
-  if (!ExpectedSyms)
+  if (!ExpectedSyms) {
+    consumeError(ExpectedSyms.takeError());
     return nullptr;
+  }
   BinaryStreamRef SymStream =
       ExpectedSyms->getSymbolArray().getUnderlyingStream();
 

``````````

</details>


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


More information about the llvm-commits mailing list