[PATCH] D133030: [AIX] llvm-readobj support a new option --exception-section for xcoff object file.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 00:29:28 PDT 2022


jhenderson added inline comments.


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:454
+  if (Error E = Binary::checkOffset(Data, SectionStart, SizeOfSection)) {
+    const char *SectionName;
+    switch (SectType) {
----------------
`SectionName` is unitialized if this function is called with an unknown section type. Either add a default case to the switch, or, preferably (in my opinion), assign it to some other initial value, preferably that includes the section type value, so that a user can see what the input is that is passed in but has gone wrong.

If there's a straightforward way to test this, e.g. using a gtest unit test, than that would be good, but I accept that this might not be the case at the moment.


================
Comment at: llvm/lib/Object/XCOFFObjectFile.cpp:472
+      ECASE(STYP_DEBUG, "debug");
+      ECASE(STYP_TYPCHK, "tyechk");
+      ECASE(STYP_OVRFLO, "ovrflo");
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133030



More information about the llvm-commits mailing list