mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-19 10:13:13 +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. llvm-svn: 138705
This commit is contained in:
parent
1b89583203
commit
70ba1d6ab4
@ -19,8 +19,11 @@ int MemoryObject::readBytes(uint64_t address,
|
||||
uint64_t* copied) const {
|
||||
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…
x
Reference in New Issue
Block a user