[libunwind] b31cb3a - unwind: fix unwind build without heap

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Fri May 15 14:45:31 PDT 2020


Author: Saleem Abdulrasool
Date: 2020-05-15T14:45:22-07:00
New Revision: b31cb3aa5ee7ea92d830b06a0a7e42c7f2791dd4

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

LOG: unwind: fix unwind build without heap

Add a missing guard for `_LIBUNWIND_NO_HEAP` around code dealing with the
`.cfi_remember_state` and `.cfi_restore_state` instructions.

Patch by Amanieu d'Antras!

Added: 
    

Modified: 
    libunwind/src/DwarfParser.hpp

Removed: 
    


################################################################################
diff  --git a/libunwind/src/DwarfParser.hpp b/libunwind/src/DwarfParser.hpp
index 4a64c219255c..d05ac468367f 100644
--- a/libunwind/src/DwarfParser.hpp
+++ b/libunwind/src/DwarfParser.hpp
@@ -401,6 +401,7 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
                         fdeInfo.fdeStart + fdeInfo.fdeLength, cieInfo,
                         upToPC - fdeInfo.pcStart, rememberStack, arch, results);
 
+#if !defined(_LIBUNWIND_NO_HEAP)
   // Clean up rememberStack. Even in the case where every DW_CFA_remember_state
   // is paired with a DW_CFA_restore_state, parseInstructions can skip restore
   // opcodes if it reaches the target PC and stops interpreting, so we have to
@@ -410,6 +411,7 @@ bool CFI_Parser<A>::parseFDEInstructions(A &addressSpace,
     free(rememberStack);
     rememberStack = next;
   }
+#endif
 
   return returnValue;
 }


        


More information about the cfe-commits mailing list