summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2019-03-09 00:04:24 +0000
committerJason Molenda <jmolenda@apple.com>2019-03-09 00:04:24 +0000
commitcee6c47a62c4d043c00eed860dc3900ad180b067 (patch)
tree16eb498d33d470eeee5e49ff169979726282575e /lldb/source
parent411210838d762303027f7ac8ddc12427d774b170 (diff)
downloadbcm5719-llvm-cee6c47a62c4d043c00eed860dc3900ad180b067.tar.gz
bcm5719-llvm-cee6c47a62c4d043c00eed860dc3900ad180b067.zip
Add parens to force the order of operations in an expression trying
to do "databuffer + offset" so that we don't overflow the uint64_t's we're using for addresses when working with high addresses. Found with clang's ubsan while doing darwin kernel debugging. <rdar://problem/48728940> llvm-svn: 355761
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Target/Memory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Target/Memory.cpp b/lldb/source/Target/Memory.cpp
index fac5e43c286..7433317bf8c 100644
--- a/lldb/source/Target/Memory.cpp
+++ b/lldb/source/Target/Memory.cpp
@@ -146,7 +146,7 @@ size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len,
}
AddrRange chunk_range(pos->first, pos->second->GetByteSize());
if (chunk_range.Contains(read_range)) {
- memcpy(dst, pos->second->GetBytes() + addr - chunk_range.GetRangeBase(),
+ memcpy(dst, pos->second->GetBytes() + (addr - chunk_range.GetRangeBase()),
dst_len);
return dst_len;
}
OpenPOWER on IntegriCloud