[lld] r238669 - Fix unsafe memory access.
Rui Ueyama
ruiu at google.com
Sat May 30 20:57:30 PDT 2015
Author: ruiu
Date: Sat May 30 22:57:30 2015
New Revision: 238669
URL: http://llvm.org/viewvc/llvm-project?rev=238669&view=rev
Log:
Fix unsafe memory access.
Modified:
lld/trunk/COFF/SymbolTable.cpp
Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=238669&r1=238668&r2=238669&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Sat May 30 22:57:30 2015
@@ -15,6 +15,8 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
+using namespace llvm;
+
namespace lld {
namespace coff {
@@ -172,7 +174,7 @@ ErrorOr<StringRef> SymbolTable::findDefa
{"WinMain", "WinMainCRTStartup"},
{"wWinMain", "wWinMainCRTStartup"},
};
- for (size_t I = 0; I < sizeof(Entries); ++I) {
+ for (size_t I = 0; I < array_lengthof(Entries); ++I) {
if (!find(Entries[I][0]))
continue;
if (auto EC = addSymbol(new Undefined(Entries[I][1])))
More information about the llvm-commits
mailing list