[llvm] r262926 - [gold] Avoid assertion failures when taking a pointer to an empty vector.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 06:02:46 PST 2016


Author: d0k
Date: Tue Mar  8 08:02:46 2016
New Revision: 262926

URL: http://llvm.org/viewvc/llvm-project?rev=262926&view=rev
Log:
[gold] Avoid assertion failures when taking a pointer to an empty vector.

Modified:
    llvm/trunk/tools/gold/gold-plugin.cpp

Modified: llvm/trunk/tools/gold/gold-plugin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/gold/gold-plugin.cpp?rev=262926&r1=262925&r2=262926&view=diff
==============================================================================
--- llvm/trunk/tools/gold/gold-plugin.cpp (original)
+++ llvm/trunk/tools/gold/gold-plugin.cpp Tue Mar  8 08:02:46 2016
@@ -620,7 +620,7 @@ static void freeSymName(ld_plugin_symbol
 
 /// Helper to get a file's symbols and a view into it via gold callbacks.
 static const void *getSymbolsAndView(claimed_file &F) {
-  ld_plugin_status status = get_symbols(F.handle, F.syms.size(), &F.syms[0]);
+  ld_plugin_status status = get_symbols(F.handle, F.syms.size(), F.syms.data());
   if (status == LDPS_NO_SYMS)
     return nullptr;
 




More information about the llvm-commits mailing list