This revision was automatically updated to reflect the committed changes. Closed by commit rL318164: Add check for self-assignment. NFC (authored by dhinton).
Repository: rL LLVM https://reviews.llvm.org/D39578 Files: lldb/trunk/source/Core/RegisterValue.cpp lldb/trunk/source/Core/Value.cpp Index: lldb/trunk/source/Core/Value.cpp =================================================================== --- lldb/trunk/source/Core/Value.cpp +++ lldb/trunk/source/Core/Value.cpp @@ -142,6 +142,9 @@ } size_t Value::AppendDataToHostBuffer(const Value &rhs) { + if (this == &rhs) + return 0; + size_t curr_size = m_data_buffer.GetByteSize(); Status error; switch (rhs.GetValueType()) { Index: lldb/trunk/source/Core/RegisterValue.cpp =================================================================== --- lldb/trunk/source/Core/RegisterValue.cpp +++ lldb/trunk/source/Core/RegisterValue.cpp @@ -539,6 +539,9 @@ } bool RegisterValue::CopyValue(const RegisterValue &rhs) { + if (this == &rhs) + return rhs.m_type == eTypeInvalid ? false : true; + m_type = rhs.m_type; switch (m_type) { case eTypeInvalid:
Index: lldb/trunk/source/Core/Value.cpp =================================================================== --- lldb/trunk/source/Core/Value.cpp +++ lldb/trunk/source/Core/Value.cpp @@ -142,6 +142,9 @@ } size_t Value::AppendDataToHostBuffer(const Value &rhs) { + if (this == &rhs) + return 0; + size_t curr_size = m_data_buffer.GetByteSize(); Status error; switch (rhs.GetValueType()) { Index: lldb/trunk/source/Core/RegisterValue.cpp =================================================================== --- lldb/trunk/source/Core/RegisterValue.cpp +++ lldb/trunk/source/Core/RegisterValue.cpp @@ -539,6 +539,9 @@ } bool RegisterValue::CopyValue(const RegisterValue &rhs) { + if (this == &rhs) + return rhs.m_type == eTypeInvalid ? false : true; + m_type = rhs.m_type; switch (m_type) { case eTypeInvalid:
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits