[PATCH] D93754: [obj2yaml] - Fix the crash in getUniquedSectionName().

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 01:37:05 PST 2021


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:128
+  unsigned SecIndex = &Sec - &Sections[0];
+  assert(&Sections[SecIndex] == &Sec);
   if (!SectionNames[SecIndex].empty())
----------------
Seems to me like this assert is rather unnecessary? That's just saying that the previous line's calculation is correct.


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

https://reviews.llvm.org/D93754



More information about the llvm-commits mailing list