1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

Don't try to dereference syms[0] on an empty vector. Reported by Todd Jackson

and Jeffrey Bosboom!

llvm-svn: 136066
This commit is contained in:
Nick Lewycky 2011-07-26 08:40:36 +00:00
parent 7f89bce2be
commit f3995084c9

View File

@ -360,6 +360,8 @@ static ld_plugin_status all_symbols_read_hook(void) {
bool anySymbolsPreserved = false;
for (std::list<claimed_file>::iterator I = Modules.begin(),
E = Modules.end(); I != E; ++I) {
if (I->syms.empty())
continue;
(*get_symbols)(I->handle, I->syms.size(), &I->syms[0]);
for (unsigned i = 0, e = I->syms.size(); i != e; i++) {
if (I->syms[i].resolution == LDPR_PREVAILING_DEF) {