fix alignment calculation in wasm reset

This commit is contained in:
Folkert 2023-04-18 21:58:19 +02:00
parent af3c4f01da
commit cabbfa52d5
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -439,12 +439,10 @@ pub fn refcount_resetref_proc_body<'a>(
// Reset structure is unique. Return a pointer to the allocation.
let then_stmt = {
let alignment = root.create_symbol(ident_ids, "alignment");
let alignment_expr = Expr::Literal(Literal::Int(
(layout_interner
.get(layout)
.alignment_bytes(layout_interner, root.target_info) as i128)
.to_ne_bytes(),
));
let alignment_int = layout_interner
.get(layout)
.allocation_alignment_bytes(layout_interner, root.target_info);
let alignment_expr = Expr::Literal(Literal::Int((alignment_int as i128).to_ne_bytes()));
let alloc_addr = root.create_symbol(ident_ids, "alloc_addr");
let alloc_addr_expr = Expr::Call(Call {
call_type: CallType::LowLevel {