mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Fix the nonnull attribute
The current version will fail if run through the `opt` tool. nonnull should have no data attached.
This commit is contained in:
parent
40026bf78e
commit
d76394ac31
1 changed files with 2 additions and 4 deletions
|
@ -4903,10 +4903,8 @@ fn expose_function_to_host_help_c_abi_v2<'a, 'ctx>(
|
|||
Attribute::get_named_enum_kind_id("byval"),
|
||||
c_abi_type.as_any_type_enum(),
|
||||
);
|
||||
let nonnull = context.create_type_attribute(
|
||||
Attribute::get_named_enum_kind_id("nonnull"),
|
||||
c_abi_type.as_any_type_enum(),
|
||||
);
|
||||
let nonnull = context
|
||||
.create_enum_attribute(Attribute::get_named_enum_kind_id("nonnull"), 0);
|
||||
// C return pointer goes at the beginning of params, and we must skip it if it exists.
|
||||
let returns_pointer = matches!(cc_return, CCReturn::ByPointer);
|
||||
let param_index = i as u32 + returns_pointer as u32;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue