mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Fix codegen for non-aarch64
This commit is contained in:
parent
48df3ecfbe
commit
94f1e399e3
1 changed files with 12 additions and 4 deletions
|
@ -3689,7 +3689,7 @@ pub fn build_setjmp_call<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> BasicValu
|
|||
call_bitcode_fn(env, &[jmp_buf.into()], bitcode::UTILS_SETJMP)
|
||||
} else {
|
||||
// Anywhere else, use the LLVM intrinsic.
|
||||
let jmp_buf_i8p = env
|
||||
let jmp_buf_i8p_arr = env
|
||||
.builder
|
||||
.build_bitcast(
|
||||
jmp_buf,
|
||||
|
@ -3710,13 +3710,21 @@ pub fn build_setjmp_call<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> BasicValu
|
|||
let zero = env.context.i32_type().const_zero();
|
||||
let fa_index = env.context.i32_type().const_zero();
|
||||
let fa = unsafe {
|
||||
env.builder
|
||||
.build_in_bounds_gep(jmp_buf_i8p, &[zero, fa_index], "frame address index")
|
||||
env.builder.build_in_bounds_gep(
|
||||
jmp_buf_i8p_arr,
|
||||
&[zero, fa_index],
|
||||
"frame address index",
|
||||
)
|
||||
};
|
||||
|
||||
env.builder.build_store(fa, frame_address);
|
||||
|
||||
env.call_intrinsic(LLVM_SETJMP, &[jmp_buf_i8p.into()])
|
||||
let jmp_buf_i8p = env.builder.build_bitcast(
|
||||
jmp_buf,
|
||||
env.context.i8_type().ptr_type(AddressSpace::Generic),
|
||||
"jmp_buf i8*",
|
||||
);
|
||||
env.call_intrinsic(LLVM_SETJMP, &[jmp_buf_i8p])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue