summaryrefslogtreecommitdiff
path: root/lldb/source/Utility/RegisterValue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility/RegisterValue.cpp')
-rw-r--r--lldb/source/Utility/RegisterValue.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Utility/RegisterValue.cpp b/lldb/source/Utility/RegisterValue.cpp
index 36790f5d8efa..7f545c214a4c 100644
--- a/lldb/source/Utility/RegisterValue.cpp
+++ b/lldb/source/Utility/RegisterValue.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterValue.cpp ---------------------------------------*- C++ -*-===//
+//===-- RegisterValue.cpp -------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -441,7 +441,7 @@ Status RegisterValue::SetValueFromString(const RegisterInfo *reg_info,
break;
case eEncodingIEEE754: {
- std::string value_string = value_str;
+ std::string value_string = std::string(value_str);
if (byte_size == sizeof(float)) {
if (::sscanf(value_string.c_str(), "%f", &flt_val) != 1) {
error.SetErrorStringWithFormat("'%s' is not a valid float string value",
@@ -728,7 +728,8 @@ const void *RegisterValue::GetBytes() const {
case eTypeFloat:
case eTypeDouble:
case eTypeLongDouble:
- return m_scalar.GetBytes();
+ m_scalar.GetBytes(buffer.bytes);
+ return buffer.bytes;
case eTypeBytes:
return buffer.bytes;
}
@@ -810,7 +811,7 @@ bool RegisterValue::operator==(const RegisterValue &rhs) const {
if (buffer.length != rhs.buffer.length)
return false;
else {
- uint8_t length = buffer.length;
+ uint16_t length = buffer.length;
if (length > kMaxRegisterByteSize)
length = kMaxRegisterByteSize;
return memcmp(buffer.bytes, rhs.buffer.bytes, length) == 0;