don't explicitly add filler bytes

leaving the memory undefined is fine
This commit is contained in:
Folkert 2020-09-21 23:55:05 +02:00
parent b42a49035a
commit 515f717536

View file

@ -947,8 +947,6 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
debug_assert!(*union_size > 1);
let ptr_size = env.ptr_bytes;
let mut filler = tag_layout.stack_size(ptr_size);
let ctx = env.context;
let builder = env.builder;
@ -985,16 +983,9 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
} else {
field_vals.push(val);
}
filler -= field_size;
}
}
if filler > 0 {
// TODO verify that this is required (better safe than sorry)
field_types.push(env.context.i8_type().array_type(filler).into());
}
// Create the struct_type
let struct_type = ctx.struct_type(field_types.into_bump_slice(), false);
let mut struct_val = struct_type.const_zero().into();