[PATCH] D71647: [llvm-objcopy][MachO] Handle relocation entries where r_extern is 0
Alexander Shaposhnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 22:34:28 PDT 2020
alexshap added inline comments.
================
Comment at: llvm/tools/llvm-objcopy/MachO/MachOReader.cpp:220
+ else {
+ assert(Info->r_symbolnum <= Sections.size() &&
+ "Invalid section index.");
----------------
MaskRay wrote:
> What if r_symbolnum = 0?
MachO section indices start from 1, not from 0, that's why (i guess) we have <= Section.size() here and -1 below.
I'd be good to add an assert that r_symbolnum > 0 in this case.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71647/new/
https://reviews.llvm.org/D71647
More information about the llvm-commits
mailing list