diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-07-26 08:40:36 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-07-26 08:40:36 +0000 |
commit | 5e0ac58bef2632a804358ec42a6ba5c6be42c450 (patch) | |
tree | 191ff4d75b5cddaf23490e036ba23f508d089eb1 /tools | |
parent | de77055a68a3fc495e01b682f00059af3e38822e (diff) |
Don't try to dereference syms[0] on an empty vector. Reported by Todd Jackson
and Jeffrey Bosboom!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gold/gold-plugin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 9e43bef31f..8cb4fb4bca 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -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) { |