mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
correct parameter offset
This commit is contained in:
parent
865e789966
commit
837ce38066
1 changed files with 9 additions and 2 deletions
|
@ -3910,8 +3910,15 @@ fn expose_function_to_host_help_c_abi_v2<'a, 'ctx, 'env>(
|
|||
Attribute::get_named_enum_kind_id("nonnull"),
|
||||
arg_type.into_pointer_type().get_element_type(),
|
||||
);
|
||||
c_function.add_attribute(AttributeLoc::Param((i + 1) as u32), byval);
|
||||
c_function.add_attribute(AttributeLoc::Param((i + 1) as u32), nonnull);
|
||||
// C return pointer goes at the beginning of params, and we must skip it if it exists.
|
||||
let param_index = (i
|
||||
+ (if matches!(cc_return, CCReturn::ByPointer) {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
})) as u32;
|
||||
c_function.add_attribute(AttributeLoc::Param(param_index), byval);
|
||||
c_function.add_attribute(AttributeLoc::Param(param_index), nonnull);
|
||||
// bitcast the ptr
|
||||
let fastcc_ptr = env
|
||||
.builder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue