mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Report failure if there are less bytes than requested in a MemoryObject.
Before we just left the remaining bytes uninitialized. This is another step in making llvm valgrind-clean again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138705 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d326d3b3ef
commit
f66f76c1a3
@ -20,7 +20,10 @@ int MemoryObject::readBytes(uint64_t address,
|
||||
uint64_t current = address;
|
||||
uint64_t limit = getBase() + getExtent();
|
||||
|
||||
while (current - address < size && current < limit) {
|
||||
if (current + size > limit)
|
||||
return -1;
|
||||
|
||||
while (current - address < size) {
|
||||
if (readByte(current, &buf[(current - address)]))
|
||||
return -1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user