I believe the current implementation of Data.Binary.Get.getPtr can invoke undefined behaviour when used for unaligned reads. I think the proper fix would be to do something similar to bytestrings Data.ByteString.Utils.UnalignedAccess, using the new unaligned read primops when available and falling back to using memcpy via the C FFI on architectures that don't support unaligned reads.
I believe the current implementation of
Data.Binary.Get.getPtrcan invoke undefined behaviour when used for unaligned reads. I think the proper fix would be to do something similar tobytestringsData.ByteString.Utils.UnalignedAccess, using the new unaligned read primops when available and falling back to usingmemcpyvia the C FFI on architectures that don't support unaligned reads.