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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 11:54:18 PST 2015


ruiu added inline comments.

================
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) {
----------------
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;

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


http://reviews.llvm.org/D15532





More information about the llvm-commits mailing list