[PATCH] D124571: Avoid strict aliasing violation on type punning inside llvm::PointerIntPair
Breno Rodrigues Guimaraes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 13:44:48 PDT 2022
brenoguim added a comment.
> I was thinking a `union { Ptr Data; void* VoidPtr }` or something like that. If you access the union via memcpy, it shouldn't matter which member of the union is active, I think?
I have no idea, maybe. But I also have to support the `getPointerAddress` API which doesn't use memcpy, so it would force me to know which member is active.
I think I'll go with the aligned array of char for safety, if that's alright.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124571/new/
https://reviews.llvm.org/D124571
More information about the llvm-commits
mailing list