From f07b38a436bfdd5841d724bebf7a023c68189f8d Mon Sep 17 00:00:00 2001 From: Igor Kulaychuk Date: Thu, 11 Oct 2018 00:17:03 +0300 Subject: [PATCH] Fix Windows build --- src/debug/netcoredbg/miprotocol.cpp | 4 ---- src/debug/netcoredbg/symbolreader.cpp | 8 +++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/debug/netcoredbg/miprotocol.cpp b/src/debug/netcoredbg/miprotocol.cpp index 6243f2f..f2a2ef8 100644 --- a/src/debug/netcoredbg/miprotocol.cpp +++ b/src/debug/netcoredbg/miprotocol.cpp @@ -461,8 +461,6 @@ HRESULT MIProtocol::SetBreakpoint( HRESULT MIProtocol::SetBreakpointCondition(uint32_t id, const std::string &condition) { - HRESULT Status; - // For each file for (auto &breakpointsIter : m_breakpoints) { @@ -685,8 +683,6 @@ HRESULT MIProtocol::HandleCommand(std::string command, return S_OK; } }, { "break-condition", [this](const std::vector &args, std::string &output) -> HRESULT { - HRESULT Status; - if (args.size() < 2) { output = "Command requires at least 2 arguments"; diff --git a/src/debug/netcoredbg/symbolreader.cpp b/src/debug/netcoredbg/symbolreader.cpp index f306d51..d327d64 100644 --- a/src/debug/netcoredbg/symbolreader.cpp +++ b/src/debug/netcoredbg/symbolreader.cpp @@ -432,8 +432,6 @@ HRESULT SymbolReader::ParseExpression( std::string &data, std::string &errorText) { - HRESULT Status; - PrepareSymbolReader(); if (parseExpressionDelegate == nullptr) @@ -466,8 +464,6 @@ HRESULT SymbolReader::ParseExpression( HRESULT SymbolReader::EvalExpression(const std::string &expr, std::string &result, int *typeId, ICorDebugValue **ppValue, GetChildCallback cb) { - HRESULT Status; - PrepareSymbolReader(); if (evalExpressionDelegate == nullptr) @@ -527,7 +523,9 @@ PVOID SymbolReader::AllocString(const std::string &str) if (sysAllocStringLen == nullptr) return nullptr; auto wstr = to_utf16(str); - BSTR bstr = sysAllocStringLen(0, wstr.size()); + if (wstr.size() > UINT_MAX) + return nullptr; + BSTR bstr = sysAllocStringLen(0, (UINT)wstr.size()); if (sysStringLen(bstr) == 0) return nullptr; memmove(bstr, wstr.data(), wstr.size() * sizeof(decltype(wstr[0]))); -- 2.34.1