Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix -fsanitize=alignment issue in numpy/_core/src/multiarray/arraytypes.c.src #25136

Merged
merged 1 commit into from
Nov 15, 2023

Commits on Nov 13, 2023

  1. Fix -fsanitize=alignment issue in numpy/_core/src/multiarray/arraytyp…

    …es.c.src
    
    OBJECT_nonzero may be called with misaligned pointers, manifesting as a
    -fsanitize=alignment failure. This is UB per C11 6.3.2.3
    
    > A pointer to an object type may be converted to a pointer to a different object type. If the resulting pointer is not correctly aligned) for the referenced type, the behavior is undefined.
    
    Nevertheless, Clang only checks alignment when the unaligned pointer is accessed.
    https://lists.llvm.org/pipermail/llvm-dev/2016-January/094012.html
    Call memcpy with unaligned arguments instead to work with new Clang
    (llvm/llvm-project#67766).
    hawkinsp committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    fa21c58 View commit details
    Browse the repository at this point in the history