[libunwind] [libunwind] Add length info for dynamic .eh_frame registration (PR #77185)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 8 22:36:08 PST 2024


https://github.com/SihangZhu updated https://github.com/llvm/llvm-project/pull/77185

>From 8d718a7deee63482091f96c5b10bc085d66b2f1a Mon Sep 17 00:00:00 2001
From: SihangZhu <zhusihang at huawei.com>
Date: Sat, 6 Jan 2024 15:43:41 +0800
Subject: [PATCH] [libunwind] Add length info for .eh_frame registration

---
 libunwind/src/libunwind.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp
index cd610377b63de8..723c8ceb5c8c94 100644
--- a/libunwind/src/libunwind.cpp
+++ b/libunwind/src/libunwind.cpp
@@ -324,7 +324,7 @@ void __unw_add_dynamic_eh_frame_section(unw_word_t eh_frame_start) {
   CFI_Parser<LocalAddressSpace>::CIE_Info cieInfo;
   CFI_Parser<LocalAddressSpace>::FDE_Info fdeInfo;
   auto p = (LocalAddressSpace::pint_t)eh_frame_start;
-  while (true) {
+  while (LocalAddressSpace::sThisAddressSpace.get32(p)) {
     if (CFI_Parser<LocalAddressSpace>::decodeFDE(
             LocalAddressSpace::sThisAddressSpace, p, &fdeInfo, &cieInfo,
             true) == NULL) {



More information about the cfe-commits mailing list