mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-04 23:32:00 +00:00
[Object] Don't crash on empty export lists.
Summary: This fixes the exports iterator if the export list is empty. Reviewers: Bigcheese, kledzik Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6732 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
94dfce45bf
commit
15067a64a9
@ -1640,7 +1640,10 @@ void ExportEntry::moveNext() {
|
||||
iterator_range<export_iterator>
|
||||
MachOObjectFile::exports(ArrayRef<uint8_t> Trie) {
|
||||
ExportEntry Start(Trie);
|
||||
Start.moveToFirst();
|
||||
if (Trie.size() == 0)
|
||||
Start.moveToEnd();
|
||||
else
|
||||
Start.moveToFirst();
|
||||
|
||||
ExportEntry Finish(Trie);
|
||||
Finish.moveToEnd();
|
||||
|
BIN
test/Object/Inputs/macho-no-exports.dylib
Executable file
BIN
test/Object/Inputs/macho-no-exports.dylib
Executable file
Binary file not shown.
4
test/Object/objdump-export-list.test
Normal file
4
test/Object/objdump-export-list.test
Normal file
@ -0,0 +1,4 @@
|
||||
RUN: llvm-objdump -exports-trie %p/Inputs/macho-no-exports.dylib | FileCheck %s
|
||||
|
||||
; Test that we don't crash with an empty export list.
|
||||
CHECK: macho-no-exports.dylib: file format Mach-O 64-bit x86-64
|
Loading…
x
Reference in New Issue
Block a user