mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
fix how free is called
somehow the previous version compiles passes llvm verification, but hangs when free is actually called
This commit is contained in:
parent
1b42831973
commit
1279999c6c
3 changed files with 10 additions and 35 deletions
|
@ -331,7 +331,6 @@ pub fn build_dec_list<'a, 'ctx, 'env>(
|
|||
let call = env
|
||||
.builder
|
||||
.build_call(function, &[original_wrapper.into()], "decrement_union");
|
||||
|
||||
call.set_call_convention(FAST_CALL_CONV);
|
||||
}
|
||||
|
||||
|
@ -414,8 +413,7 @@ fn build_dec_list_help<'a, 'ctx, 'env>(
|
|||
{
|
||||
builder.position_at_end(then_block);
|
||||
if !env.leak {
|
||||
let free = builder.build_free(refcount_ptr);
|
||||
builder.insert_instruction(&free, None);
|
||||
builder.build_free(refcount_ptr);
|
||||
}
|
||||
builder.build_unconditional_branch(cont_block);
|
||||
}
|
||||
|
|
|
@ -592,6 +592,15 @@ mod gen_list {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_concat_two_bigger_non_empty_lists() {
|
||||
assert_evals_to!(
|
||||
"List.concat [ 1.1, 2.2 ] [ 3.3, 4.4, 5.5 ]",
|
||||
&[1.1, 2.2, 3.3, 4.4, 5.5],
|
||||
&'static [f64]
|
||||
);
|
||||
}
|
||||
|
||||
fn assert_concat_worked(num_elems1: i64, num_elems2: i64) {
|
||||
let vec1: Vec<i64> = (0..num_elems1)
|
||||
.map(|i| 12345 % (i + num_elems1 + num_elems2 + 1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue