summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/StreamableMemoryObject.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2012-06-20 00:16:40 +0000
committerKaelyn Uhrain <rikka@google.com>2012-06-20 00:16:40 +0000
commit2212f807c7774aa168e9242300b420beb1915650 (patch)
tree2bd6e333339c93d4f893e6acc746ef754ea42bcb /llvm/lib/Support/StreamableMemoryObject.cpp
parent5f96883d446ff00665474b8882c23fbc98f47b12 (diff)
downloadbcm5719-llvm-2212f807c7774aa168e9242300b420beb1915650.tar.gz
bcm5719-llvm-2212f807c7774aa168e9242300b420beb1915650.zip
Don't assert when given an empty range.
llvm::RawMemoryObject handles empty ranges just fine, and the assert can be triggered in the wild by e.g. invoking clang with a file that included an empty pre-compiled header file when clang has been built with assertions enabled. Without assertions enabled, clang will properly report that the empty file is not a valid PCH. llvm-svn: 158769
Diffstat (limited to 'llvm/lib/Support/StreamableMemoryObject.cpp')
-rw-r--r--llvm/lib/Support/StreamableMemoryObject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/StreamableMemoryObject.cpp b/llvm/lib/Support/StreamableMemoryObject.cpp
index c23f07b8fc3..fe3752a77ad 100644
--- a/llvm/lib/Support/StreamableMemoryObject.cpp
+++ b/llvm/lib/Support/StreamableMemoryObject.cpp
@@ -20,7 +20,7 @@ class RawMemoryObject : public StreamableMemoryObject {
public:
RawMemoryObject(const unsigned char *Start, const unsigned char *End) :
FirstChar(Start), LastChar(End) {
- assert(LastChar > FirstChar && "Invalid start/end range");
+ assert(LastChar >= FirstChar && "Invalid start/end range");
}
virtual uint64_t getBase() const { return 0; }
OpenPOWER on IntegriCloud