[PATCH] D83741: [libunwind] Fix CIE v1 return address parsing

Ryan Prichard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 22:28:04 PDT 2020


rprichard updated this revision to Diff 277669.
rprichard added a comment.

Stylistic changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83741/new/

https://reviews.llvm.org/D83741

Files:
  libunwind/src/DwarfParser.hpp


Index: libunwind/src/DwarfParser.hpp
===================================================================
--- libunwind/src/DwarfParser.hpp
+++ libunwind/src/DwarfParser.hpp
@@ -336,7 +336,8 @@
   // parse data alignment factor
   cieInfo->dataAlignFactor = (int)addressSpace.getSLEB128(p, cieContentEnd);
   // parse return address register
-  uint64_t raReg = addressSpace.getULEB128(p, cieContentEnd);
+  uint64_t raReg = (version == 1) ? addressSpace.get8(p++)
+                                  : addressSpace.getULEB128(p, cieContentEnd);
   assert(raReg < 255 && "return address register too large");
   cieInfo->returnAddressRegister = (uint8_t)raReg;
   // parse augmentation data based on augmentation string


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83741.277669.patch
Type: text/x-patch
Size: 718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200714/c4ae90e2/attachment.bin>


More information about the llvm-commits mailing list