diff options
| author | 2018-04-06 14:26:03 +0000 | |
|---|---|---|
| committer | 2018-04-06 14:26:03 +0000 | |
| commit | bdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch) | |
| tree | c50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/lib/ProfileData/InstrProfReader.cpp | |
| parent | Print a 'p' flag for file descriptors that were opened after pledge(2). (diff) | |
| download | wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip | |
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/lib/ProfileData/InstrProfReader.cpp')
| -rw-r--r-- | gnu/llvm/lib/ProfileData/InstrProfReader.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gnu/llvm/lib/ProfileData/InstrProfReader.cpp b/gnu/llvm/lib/ProfileData/InstrProfReader.cpp index 1b39a0695aa..23c9a2676b9 100644 --- a/gnu/llvm/lib/ProfileData/InstrProfReader.cpp +++ b/gnu/llvm/lib/ProfileData/InstrProfReader.cpp @@ -61,7 +61,7 @@ InstrProfReader::create(const Twine &Path) { Expected<std::unique_ptr<InstrProfReader>> InstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) { // Sanity check the buffer. - if (Buffer->getBufferSize() > std::numeric_limits<unsigned>::max()) + if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<unsigned>::max()) return make_error<InstrProfError>(instrprof_error::too_large); if (Buffer->getBufferSize() == 0) @@ -99,7 +99,7 @@ IndexedInstrProfReader::create(const Twine &Path) { Expected<std::unique_ptr<IndexedInstrProfReader>> IndexedInstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) { // Sanity check the buffer. - if (Buffer->getBufferSize() > std::numeric_limits<unsigned>::max()) + if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<unsigned>::max()) return make_error<InstrProfError>(instrprof_error::too_large); // Create the reader. @@ -733,8 +733,6 @@ Error IndexedInstrProfReader::getFunctionCounts(StringRef FuncName, } Error IndexedInstrProfReader::readNextRecord(NamedInstrProfRecord &Record) { - static unsigned RecordIndex = 0; - ArrayRef<NamedInstrProfRecord> Data; Error E = Index->getRecords(Data); |
