Index: source/Core/RegisterValue.cpp =================================================================== --- source/Core/RegisterValue.cpp +++ source/Core/RegisterValue.cpp @@ -539,6 +539,11 @@ } bool RegisterValue::CopyValue(const RegisterValue &rhs) { + // Maintain current behavior, but guard against self-assignment (see memcpy + // below).? + if (this == &rhs) + return rhs.m_type == eTypeInvalid ? false : true; + m_type = rhs.m_type; switch (m_type) { case eTypeInvalid: Index: source/Core/Value.cpp =================================================================== --- source/Core/Value.cpp +++ source/Core/Value.cpp @@ -143,6 +143,8 @@ } size_t Value::AppendDataToHostBuffer(const Value &rhs) { + // FIXME: What should we do if this == &rhs? + // If we allow, change s/memcpy/memmove/ below. size_t curr_size = m_data_buffer.GetByteSize(); Status error; switch (rhs.GetValueType()) {