Skip to content

Undefined behavior because of unaligned reads? #226

@konsumlamm

Description

@konsumlamm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions