Fix undefined behavior in PxUnionCast#65
Conversation
Fixes crash in linux with a new version of clang. The C++ standard does not define behavior of accessing a different union member from the one that was last written. std::memcpy is a defined way to accomplish the same.
|
Hi, |
|
Hi Ales, Thanks for the quick reply! LLVM versions r327616 and r327695 were the ones we tested. A bit more detail: In PsUnixSse2InlineAoS.h there's a gMaskXYZ constant which is initialised with the output of PxUnionCast - with these new compiler versions, the mask had all zeros on all 4 components (instead of all 1, all 1, all 1, all 0 as intended). Cheers, |
|
Hi again Ales, Was this or a similar fix submitted? Currently we have fixed the gMaskXYZ = 0 problem with the change in this PR. Regards, |
|
Hi Ricardo, |
|
The issue should be resolved in next update. Thanks for the report! |
Fixes crash in linux with a new version of clang.
The C++ standard does not define behavior of accessing a different union member from the one that was last written. std::memcpy is a defined way to accomplish the same.