From 3ffbbd91b26af34ad1208f0c8dd353c3cab80dd8 Mon Sep 17 00:00:00 2001 From: g4titanx Date: Thu, 6 Feb 2025 19:57:24 +0100 Subject: [PATCH] fix: handle pointee_align --- src/abi.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/abi.rs b/src/abi.rs index 14fc23593f0..c6633f137c2 100644 --- a/src/abi.rs +++ b/src/abi.rs @@ -138,6 +138,13 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { if attrs.regular.contains(rustc_target::abi::call::ArgAttribute::NonNull) { non_null_args.push(arg_index as i32 + 1); } + if let Some(align) = attrs.pointee_align { + if let Some(pointee) = ty.get_pointee() { + ty = cx.type_ptr_to(pointee.get_aligned(align.bytes())); + } else { + ty = ty.get_aligned(align.bytes()); + } + } ty }; #[cfg(not(feature = "master"))]