boostorg / python

Boost.org python module
http://boostorg.github.io/python
Boost Software License 1.0
465 stars 201 forks source link

Pass alignment to holder::allocate #425

Open vslashg opened 9 months ago

vslashg commented 9 months ago

aca3c8 added an alignment argument to holder::allocate which defaults to 1. However, make_constructor.hpp uses this function to create storage for a pointer and was never changed to pass an alignment, so it uses the too-permissive default.

This causes unaligned pointers to be created on most architectures (although the x86 family tolerates it). This can be detected as a failure by running projects under Clang ubsan.