Fix bug in vector8 operator=
operator= would try to overwrite it self under some circumstances.
This was found with valgrind and using -O0. It works with -O2.
(cherry picked from commit 9ea6604439)
This commit is contained in:
parent
eb9d79ec61
commit
d2a900d187
|
|
@ -2308,7 +2308,8 @@ vvp_vector8_t::vvp_vector8_t(const vvp_vector4_t&that,
|
|||
vvp_vector8_t& vvp_vector8_t::operator= (const vvp_vector8_t&that)
|
||||
{
|
||||
// Assign to self.
|
||||
if (size_ > PTR_THRESH && that.size_ > PTR_THRESH && ptr_ == that.ptr_)
|
||||
if (this == &that || (size_ > PTR_THRESH && that.size_ > PTR_THRESH &&
|
||||
ptr_ == that.ptr_))
|
||||
return *this;
|
||||
|
||||
if (size_ != that.size_) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue