Skip to content

Commit d89d171

Browse files
Add pad_to_align to syscall payload value (#1175)
From Layout::extend documentation: In order to match C representation layout repr(C), you should call pad_to_align after extending the layout with all fields. (There is no way to match the default Rust representation layout repr(Rust), as it is unspecified.)
1 parent 79d9878 commit d89d171

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libfuncs/starknet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ pub fn build_deploy<'ctx, 'this>(
15741574
)?;
15751575

15761576
let payload_ty = llvm::r#type::r#struct(context, &[p0_ty, p1_ty], false);
1577-
let payload_layout = p0_layout.extend(p1_layout)?.0;
1577+
let payload_layout = p0_layout.extend(p1_layout)?.0.pad_to_align();
15781578

15791579
let full_layout = tag_layout.extend(payload_layout)?.0;
15801580
layout = Layout::from_size_align(

0 commit comments

Comments
 (0)