[llvm] Fix crash due to un-checked error in LVReaderHandler::handleArchive method (PR #118951)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 02:29:51 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: None (aurelien35)

<details>
<summary>Changes</summary>

Fix crash due to un-checked error in LVReaderHandler::handleArchive method.

Correction thanks to @<!-- -->CarlosAlbertoEnciso suggestion

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


1 Files Affected:

- (modified) llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp (+3) 


``````````diff
diff --git a/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp b/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp
index 71750f3d114c11..7d64100c60c21a 100644
--- a/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp
@@ -88,6 +88,9 @@ Error LVReaderHandler::handleArchive(LVReaders &Readers, StringRef Filename,
                                Filename.str().c_str());
   }
 
+  if (Err)
+    return createStringError(errorToErrorCode(std::move(Err)), "%s",
+                               Filename.str().c_str());
   return Error::success();
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list