[PATCH] D78926: [libunwind] Fix libunwind build without a heap

Amanieu d'Antras via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 07:29:31 PDT 2020


Amanieu created this revision.
Amanieu added a reviewer: compnerd.
Amanieu added a project: libunwind.
Herald added a project: LLVM.
Herald added subscribers: libcxx-commits, llvm-commits.
Herald added a reviewer: libunwind.

This patch adds a missing guard for _LIBUNWIND_NO_HEAP around code dealing with the .cfi_remember_state and .cfi_restore_state instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78926

Files:
  libunwind/src/DwarfParser.hpp


Index: libunwind/src/DwarfParser.hpp
===================================================================
--- libunwind/src/DwarfParser.hpp
+++ libunwind/src/DwarfParser.hpp
@@ -401,6 +401,7 @@
                         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 @@
     free(rememberStack);
     rememberStack = next;
   }
+#endif
 
   return returnValue;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78926.260314.patch
Type: text/x-patch
Size: 738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200427/fd1c8738/attachment.bin>


More information about the llvm-commits mailing list