mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[Object][MachO] Handle end iterator in getSymbolType()
Fix a bug in MachOObjectFile::getSymbolType() that it is not checking if the iterator is end() before deference the iterator. Instead, return `Other` type, which aligns with the behavior of `llvm-nm`. rdar://75291638 Reviewed By: davide, ab Differential Revision: https://reviews.llvm.org/D98739
This commit is contained in:
parent
6698320324
commit
0d2a8c0614
@ -1836,6 +1836,8 @@ MachOObjectFile::getSymbolType(DataRefImpl Symb) const {
|
||||
if (!SecOrError)
|
||||
return SecOrError.takeError();
|
||||
section_iterator Sec = *SecOrError;
|
||||
if (Sec == section_end())
|
||||
return SymbolRef::ST_Other;
|
||||
if (Sec->isData() || Sec->isBSS())
|
||||
return SymbolRef::ST_Data;
|
||||
return SymbolRef::ST_Function;
|
||||
|
Loading…
Reference in New Issue
Block a user