Cycles: Avoid memcpy of intersecting memory
Could happen when assignment happens to self during sorting.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user