[Lldb-commits] [lldb] r255083 - Fix DoReadMemory for Windows mini dumps.
Adrian McCarthy via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 8 16:29:39 PST 2015
Date: Tue Dec 8 18:29:38 2015
New Revision: 255083
Fix DoReadMemory for Windows mini dumps.
Differential Revision: http://reviews.llvm.org/D15359
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp Tue Dec 8 18:29:38 2015
@@ -30,6 +30,7 @@
@@ -267,7 +268,9 @@ ProcessWinMiniDump::DoReadMemory(lldb::a
// There's at least some overlap between the beginning of the desired range
// (addr) and the current range. Figure out where the overlap begins and
// how much overlap there is, then copy it to the destination buffer.
- const size_t offset = range.start - addr;
+ lldbassert(range.start <= addr);
+ const size_t offset = addr - range.start;
+ lldbassert(offset < range.size);
const size_t overlap = std::min(size, range.size - offset);
std::memcpy(buf, range.ptr + offset, overlap);
More information about the lldb-commits