mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 23:00:15 +00:00
[ELF2] Don't allocate more SymbolBodies than needed.
Differential Revision: http://reviews.llvm.org/D12605 llvm-svn: 246802
This commit is contained in:
parent
246e618e77
commit
34812ba258
@ -110,7 +110,7 @@ template <class ELFT> void elf2::ObjectFile<ELFT>::initializeSymbols() {
|
||||
if (FirstNonLocal > NumSymbols)
|
||||
error("Invalid sh_info in symbol table");
|
||||
Syms = llvm::make_range(Syms.begin() + FirstNonLocal, Syms.end());
|
||||
SymbolBodies.reserve(NumSymbols);
|
||||
SymbolBodies.reserve(NumSymbols - FirstNonLocal);
|
||||
for (const Elf_Sym &Sym : Syms)
|
||||
SymbolBodies.push_back(createSymbolBody(StringTable, &Sym));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user