[llvm-branch-commits] [lldb] r319035 - Merging r316106:
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Nov 27 07:22:38 PST 2017
Author: tstellar
Date: Mon Nov 27 07:22:38 2017
New Revision: 319035
URL: http://llvm.org/viewvc/llvm-project?rev=319035&view=rev
Log:
Merging r316106:
------------------------------------------------------------------------
r316106 | labath | 2017-10-18 11:52:16 -0700 (Wed, 18 Oct 2017) | 4 lines
lldb-server tests: Fix undefined behavior
We were creating a StringRef pointing to a temporary string. Problem manifested
itself when running the test on osx.
------------------------------------------------------------------------
Modified:
lldb/branches/release_50/unittests/tools/lldb-server/tests/MessageObjects.cpp
Modified: lldb/branches/release_50/unittests/tools/lldb-server/tests/MessageObjects.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/release_50/unittests/tools/lldb-server/tests/MessageObjects.cpp?rev=319035&r1=319034&r2=319035&view=diff
==============================================================================
--- lldb/branches/release_50/unittests/tools/lldb-server/tests/MessageObjects.cpp (original)
+++ lldb/branches/release_50/unittests/tools/lldb-server/tests/MessageObjects.cpp Mon Nov 27 07:22:38 2017
@@ -67,8 +67,8 @@ StringRef ThreadInfo::ReadRegister(unsig
bool ThreadInfo::ReadRegisterAsUint64(unsigned int register_id,
uint64_t &value) const {
- StringRef value_str(m_registers.lookup(register_id));
- if (value_str.getAsInteger(16, value)) {
+ std::string value_str(m_registers.lookup(register_id));
+ if (!llvm::to_integer(value_str, value, 16)) {
GTEST_LOG_(ERROR)
<< formatv("ThreadInfo: Unable to parse register value at {0}.",
register_id)
More information about the llvm-branch-commits
mailing list