[lld-macho] Fix LOH parsing segfault
authorJez Ng <jezng@fb.com>
Thu, 21 Jul 2022 17:58:15 +0000 (13:58 -0400)
committerJez Ng <jezng@fb.com>
Thu, 21 Jul 2022 17:59:39 +0000 (13:59 -0400)
commitec315a5fa1c5880df0f6a25cede9282bb551c8a1
tree1356d12f429d6e735c91eb19ea86c2a0b5e14e0b
parent56094296f5de9227e76205126be90ff1bffd9705
[lld-macho] Fix LOH parsing segfault

`advanceSubsection()` didn't account for the possibility that a section
could have no subsections.

Reviewed By: #lld-macho, thakis, BertalanD

Differential Revision: https://reviews.llvm.org/D130288
lld/MachO/InputFiles.cpp
lld/test/MachO/loh-parsing.s [new file with mode: 0644]