Updated refcount logic

This commit is contained in:
J.Teeuwissen 2023-04-26 17:39:46 +02:00
parent 0fe94cbd90
commit 74f2b0afda
No known key found for this signature in database
GPG key ID: DB5F7A1ED8D478AD
4 changed files with 29 additions and 71 deletions

View file

@ -1252,8 +1252,15 @@ pub(crate) fn run_low_level<'a, 'ctx, 'env>(
}
RefCountIsUnique => {
arguments!(input);
call_bitcode_fn(env, &[input], &bitcode::UTILS_IS_UNIQUE)
arguments!(data_ptr);
let ptr = env.builder.build_pointer_cast(
data_ptr.into_pointer_value(),
env.context.i8_type().ptr_type(AddressSpace::default()),
"cast_to_i8_ptr",
);
call_bitcode_fn(env, &[ptr.into()], &bitcode::UTILS_IS_UNIQUE)
}
Unreachable => match RocReturn::from_layout(env, layout_interner, layout) {