Skip to content

Commit 26e0b50

Browse files
committed
[lldb][lldb-dap] Fix compilation error on 32 bit platforms
#109485 tried to std::min between size_t and uint64_t. size_t on 32 bit is 32 bits. https://lab.llvm.org/buildbot/#/builders/18/builds/4430/steps/4/logs/stdio Explicitly select the size_t template to fix this. This will truncate one of the arguments but that's the count_requested. If you're debugging from a 32 bit host and you asked it to read > 32 bit range of memory from a 64 bit target, you weren't going to have any success anyway. The final result needs to be size_t to resize the vector with.
1 parent d288574 commit 26e0b50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4451,7 +4451,7 @@ void request_readMemory(const llvm::json::Object &request) {
44514451
g_dap.SendJSON(llvm::json::Value(std::move(response)));
44524452
return;
44534453
}
4454-
buf.resize(std::min(count_result, count_requested));
4454+
buf.resize(std::min<size_t>(count_result, count_requested));
44554455

44564456
llvm::json::Object body;
44574457
std::string formatted_addr = "0x" + llvm::utohexstr(addr_int);

0 commit comments

Comments
 (0)