Skip to content

Commit 52aea72

Browse files
DavidSpickettJDevlieghere
authored andcommitted
[lldb][lldb-dap] Fix compilation error on 32 bit platforms
llvm#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. (cherry picked from commit 26e0b50)
1 parent b8d2671 commit 52aea72

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
@@ -4454,7 +4454,7 @@ void request_readMemory(const llvm::json::Object &request) {
44544454
g_dap.SendJSON(llvm::json::Value(std::move(response)));
44554455
return;
44564456
}
4457-
buf.resize(std::min(count_result, count_requested));
4457+
buf.resize(std::min<size_t>(count_result, count_requested));
44584458

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

0 commit comments

Comments
 (0)