Fix unsafe memory access.

llvm-svn: 238669
This commit is contained in:
Rui Ueyama 2015-05-31 03:57:30 +00:00
parent 3ee0fe4c2c
commit d68ff34ad2
1 changed files with 3 additions and 1 deletions

View File

@ -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::findDefaultEntry() {
{"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])))