[PATCH] D53264: [ARM64] [Windows] Add unwind support to llvm-readobj

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 18:45:20 PDT 2018


efriedma added a comment.

I think this is looking good; hopefully Reid will get a chance to look briefly to make sure this matches what he was expecting.



================
Comment at: tools/llvm-readobj/ARMWinEHPrinter.cpp:785
+      if ((Opcodes[OI] & DecodeRing[DI].Mask) == DecodeRing[DI].Value) {
+        Terminated = (this->*DecodeRing[DI].Routine)(Opcodes.data(), OI, 0, Prologue);
+        break;
----------------
This can still read a few bytes past the end of the unwind data if, for example, the last byte is 0xe0.


================
Comment at: tools/llvm-readobj/ARMWinEHPrinter.cpp:833
+  if ((int64_t)(Contents.size() - Offset - 4 -
+      (XData.E() ? 0 : XData.EpilogueCount() * 4)) < (int64_t)ByteCodeLength)
+    report_fatal_error("Malformed unwind data");
----------------
Needs another 8 bytes if X() is set.

The literal "4" for the header should be 4 * HeaderWords().


Repository:
  rL LLVM

https://reviews.llvm.org/D53264





More information about the llvm-commits mailing list