mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
align alloca
This commit is contained in:
parent
48e0938e8b
commit
aa08256aef
1 changed files with 8 additions and 0 deletions
|
@ -181,7 +181,15 @@ pub fn call_bitcode_fn_fixing_for_convention<'a, 'ctx, 'env>(
|
||||||
.try_into()
|
.try_into()
|
||||||
.expect("Zig bitcode return type is not a basic type!");
|
.expect("Zig bitcode return type is not a basic type!");
|
||||||
|
|
||||||
|
// when we write an i128 into this (happens in NumToInt), zig expects this pointer to
|
||||||
|
// be 16-byte aligned. Not doing so is UB and will immediately fail on CI
|
||||||
let cc_return_value_ptr = env.builder.build_alloca(cc_return_type, "return_value");
|
let cc_return_value_ptr = env.builder.build_alloca(cc_return_type, "return_value");
|
||||||
|
cc_return_value_ptr
|
||||||
|
.as_instruction()
|
||||||
|
.unwrap()
|
||||||
|
.set_alignment(16)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
let fixed_args: Vec<BasicValueEnum<'ctx>> = [cc_return_value_ptr.into()]
|
let fixed_args: Vec<BasicValueEnum<'ctx>> = [cc_return_value_ptr.into()]
|
||||||
.iter()
|
.iter()
|
||||||
.chain(args)
|
.chain(args)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue