[Lldb-commits] [lldb] 72105b9 - Fix compilation error in ObjectFileMachO::ParseSymtab

Vedant Kumar via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 25 11:17:05 PDT 2019


Author: Vedant Kumar
Date: 2019-10-25T11:16:51-07:00
New Revision: 72105b9dcd67eb539b77a77c5ed3530da1171724

URL: https://github.com/llvm/llvm-project/commit/72105b9dcd67eb539b77a77c5ed3530da1171724
DIFF: https://github.com/llvm/llvm-project/commit/72105b9dcd67eb539b77a77c5ed3530da1171724.diff

LOG: Fix compilation error in ObjectFileMachO::ParseSymtab

Added: 
    

Modified: 
    lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 70e0997e2d3b..d82a1addd334 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -2737,9 +2737,12 @@ size_t ObjectFileMachO::ParseSymtab() {
                      nlist_index++) {
                   /////////////////////////////
                   {
-                    struct nlist_64 nlist;
-                    if (!ParseNList(dsc_local_symbols_data, nlist_data_offset, nlist_byte_size, nlist)
+                    llvm::Optional<struct nlist_64> nlist_maybe =
+                        ParseNList(dsc_local_symbols_data, nlist_data_offset,
+                                   nlist_byte_size);
+                    if (!nlist_maybe)
                       break;
+                    struct nlist_64 nlist = *nlist_maybe;
 
                     SymbolType type = eSymbolTypeInvalid;
                     const char *symbol_name = dsc_local_symbols_data.PeekCStr(


        


More information about the lldb-commits mailing list