Cycles: Avoid memcpy of intersecting memory

Could happen when assignment happens to self during sorting.
This commit is contained in:
Sergey Sharybin 2015-03-20 21:14:50 +05:00
parent 8ff4c53e63
commit 919a665497

@ -113,7 +113,9 @@ public:
__forceinline int prim_type() const { return type; }
BVHReference& operator=(const BVHReference &arg) {
memcpy(this, &arg, sizeof(BVHReference));
if(&arg != this) {
memcpy(this, &arg, sizeof(BVHReference));
}
return *this;
}