forked from OSchip/llvm-project
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
This commit is contained in:
parent
5f96883d44
commit
2212f807c7
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue