Skip to content

Commit 3ffbbd9

Browse files
committed
fix: handle pointee_align
1 parent 4380568 commit 3ffbbd9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/abi.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
138138
if attrs.regular.contains(rustc_target::abi::call::ArgAttribute::NonNull) {
139139
non_null_args.push(arg_index as i32 + 1);
140140
}
141+
if let Some(align) = attrs.pointee_align {
142+
if let Some(pointee) = ty.get_pointee() {
143+
ty = cx.type_ptr_to(pointee.get_aligned(align.bytes()));
144+
} else {
145+
ty = ty.get_aligned(align.bytes());
146+
}
147+
}
141148
ty
142149
};
143150
#[cfg(not(feature = "master"))]

0 commit comments

Comments
 (0)