summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/unittests/Host/NativeProcessProtocolTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/unittests/Host/NativeProcessProtocolTest.cpp b/lldb/unittests/Host/NativeProcessProtocolTest.cpp
index 39d636207a5..298c2909b61 100644
--- a/lldb/unittests/Host/NativeProcessProtocolTest.cpp
+++ b/lldb/unittests/Host/NativeProcessProtocolTest.cpp
@@ -131,7 +131,8 @@ llvm::Expected<std::vector<uint8_t>> FakeMemory::Read(addr_t Addr,
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"Address out of range.");
Size = std::min(Size, Data.size() - (size_t)Addr);
- return std::vector<uint8_t>(&Data[Addr], &Data[Addr + Size]);
+ auto Begin = std::next(Data.begin(), Addr);
+ return std::vector<uint8_t>(Begin, std::next(Begin, Size));
}
llvm::Expected<size_t> FakeMemory::Write(addr_t Addr,
OpenPOWER on IntegriCloud