On Wed, 14 Oct 2026 11:08:52 +0200 Sebastien Bacher <[email protected]> wrote: > From 49814f6b47ed99e273edc5198a6ebd7fa19e813a Mon Sep 17 00:00:00 2001 > From: Jan Boon <[email protected]> > Date: Sat, 19 Feb 2022 17:30:38 +0100 > Subject: [PATCH] Fix bad alignment assumption in `object_rep` broken by > lua_newuserdata (#50) > > * Match alignment of `object_rep` to `lua_newuserdata`. Fixes alignment > assumption in placement new > * Compatibility with lua 5.3 > > Origin: other, > https://github.com/Oberon00/luabind/commit/49814f6b47ed99e273edc5198a6ebd7fa19e813a > Bug: https://github.com/Oberon00/luabind/issues/42 > Forwarded: not-needed > Last-Update: 2026-10-14 > > --- > luabind/detail/object_rep.hpp | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/luabind/detail/object_rep.hpp b/luabind/detail/object_rep.hpp > index 07272e64..519f7140 100644 > --- a/luabind/detail/object_rep.hpp > +++ b/luabind/detail/object_rep.hpp > @@ -97,8 +97,14 @@ namespace luabind { namespace detail > > void operator=(object_rep const&); > > +#ifdef LUAI_MAXALIGN > + struct cD { char c; union { LUAI_MAXALIGN; } u; }; > +#else > + struct cD { char c; union { lua_Number n; double u; void *s; lua_Integer i; > long l; } u; }; > +#endif > BOOST_STATIC_CONSTANT(std::size_t, instance_buffer_size=32); > - boost::aligned_storage<instance_buffer_size> m_instance_buffer; > + BOOST_STATIC_CONSTANT(std::size_t, instance_buffer_align=offsetof(struct > cD, u)); > + boost::aligned_storage<instance_buffer_size, instance_buffer_align> > m_instance_buffer; > instance_holder* m_instance; > class_rep* m_classrep; // the class information about this object's type > std::size_t m_dependency_cnt; // counts dependencies
Hi Sebastien, I currently working on next release, next release also contain your sended patch, and after next release get upload to unstable this submited bug must be close too. Thanks for your report. Regards. -- Iliya Abolghasemi (gfaerny) Fingerprint: 4DEF 5756 FDE5 C5EC 9B3D FB3C DC84 0F69 C960 72C3 https://gfaerny.cc

