mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Check RequiresNullTerminator first, or we might read from an invalid address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127853 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b4b8b0cc90
commit
49ab1207df
@ -48,7 +48,7 @@ MemoryBuffer::~MemoryBuffer() { }
|
||||
/// memory, memory that we know is already null terminated.
|
||||
void MemoryBuffer::init(const char *BufStart, const char *BufEnd,
|
||||
bool RequiresNullTerminator) {
|
||||
assert((BufEnd[0] == 0 || !RequiresNullTerminator) &&
|
||||
assert((!RequiresNullTerminator || BufEnd[0] == 0) &&
|
||||
"Buffer is not null terminated!");
|
||||
BufferStart = BufStart;
|
||||
BufferEnd = BufEnd;
|
||||
|
Loading…
x
Reference in New Issue
Block a user