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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 19 11:50:10 PDT 2018


efriedma added inline comments.


================
Comment at: tools/llvm-readobj/ARMWinEHPrinter.cpp:789
+          SW.startLine() << format("The last opcode is likely bad, as we have "
+                                   "gone past the unwind data");
+        break;
----------------
It's wrong to read past the end of the section, and then print an error afterwards, rather than checking before you read the data; you can't print an error after llvm-readobj crashes.  (You're only reading a few bytes past the end of the section, so you can get away with it sometimes, but not in general.)

Maybe the RingEntry should contain the opcode size.


Repository:
  rL LLVM

https://reviews.llvm.org/D53264





More information about the llvm-commits mailing list