[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:28:53 PST 2024


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

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

Correction thanks to @CarlosAlbertoEnciso suggestion

>From 40c944b8166446682bd4f747408faeeda5e18bbf Mon Sep 17 00:00:00 2001
From: aurelien35 <aurelien35 at users.noreply.github.com>
Date: Fri, 6 Dec 2024 11:27:31 +0100
Subject: [PATCH] Update LVReaderHandler.cpp

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

Correction thanks to @CarlosAlbertoEnciso suggestion
---
 llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp | 3 +++
 1 file changed, 3 insertions(+)

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();
 }
 



More information about the llvm-commits mailing list