[all-commits] [llvm/llvm-project] 77b6ef: [ADT] [lld-macho] Check for end iterator deref in ...
Daniel Bertalan via All-commits
all-commits at lists.llvm.org
Tue Jun 21 12:50:13 PDT 2022
Author: Daniel Bertalan <dani at danielbertalan.dev>
Date: 2022-06-21 (Tue, 21 Jun 2022)
[ADT] [lld-macho] Check for end iterator deref in filter_iterator_base
If ld64.lld was supplied an object file that had a `__debug_abbrev` or
`__debug_str` section, but didn't have any compile unit DIEs in
`__debug_info`, it would dereference an iterator pointing to the empty
array of DIEs. This underlying issue started causing segmentation faults
when parsing for `__debug_info` was addded in D128184. That commit was
reverted, and this one fixes the invalid dereference to allow relanding
This commit adds an assertion to `filter_iterator_base`'s dereference
operators to catch bugs like this one.
Ran check-llvm, check-clang and check-lld.
Differential Revision: https://reviews.llvm.org/D128294
More information about the All-commits