[Lldb-commits] [PATCH] D15359: Fix DoReadMemory for Windows mini dumps.
Adrian McCarthy via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 8 16:32:42 PST 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL255083: Fix DoReadMemory for Windows mini dumps. (authored by amccarth).
Changed prior to commit:
http://reviews.llvm.org/D15359?vs=42243&id=42246#toc
Repository:
rL LLVM
http://reviews.llvm.org/D15359
Files:
lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
Index: lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
+++ lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
@@ -30,6 +30,7 @@
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/UnixSignals.h"
+#include "lldb/Utility/LLDBAssert.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
@@ -267,7 +268,9 @@
// 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);
return overlap;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15359.42246.patch
Type: text/x-patch
Size: 1141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151209/236293e0/attachment.bin>
More information about the lldb-commits
mailing list