[PATCH] D15532: [ELF] - implement support of extended length field for CIE/FDE records of eh_frame.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 01:11:53 PST 2015


grimar added a comment.

In http://reviews.llvm.org/D15532#311052, @emaste wrote:

> Looks reasonable. How about a test for successful Is64Dwarf though?


Added test.


================
Comment at: ELF/OutputSections.cpp:1001-1002
@@ +1000,4 @@
+    error("Truncated CIE/FDE length");
+  uint64_t Length = read32<E>(D.data());
+  bool Is64Dwarf = false;
+  if (Length == (uint32_t)-1) {
----------------
ruiu wrote:
> Can you return early if it's 32 bit?
> 
>   uint64_t Len = read32<E>(D.data());
>   if (Len < UINT32_MAX) {
>     if (Len > D.size())
>       error("CIE/FIE ends past the end of the section");
>     return Len + 4;
>   }
>   if (D.size() < 12)
>     error("Truncated CIE/FDE length");
>   Len = read64<E>(D.data() + 4);
>   if (Len > D.size())
>     error("CIE/FIE ends past the end of the section");
>   return Len + 12;
Done.


================
Comment at: ELF/OutputSections.h:304
@@ -303,1 +303,3 @@
 private:
+  uintX_t readEntryLength(ArrayRef<uint8_t> &D);
+
----------------
ruiu wrote:
> ArrayRef is usually supposed to be passed by value as it's basically a pointer to an array.
Ok, removed &.


http://reviews.llvm.org/D15532





More information about the llvm-commits mailing list