insert reset/reuse for Cond

This commit is contained in:
Folkert 2020-07-27 15:10:07 +02:00
parent edca61e2d6
commit 95365959f2
4 changed files with 33 additions and 22 deletions

View file

@ -174,7 +174,7 @@ pub fn build_expr<'a, 'ctx, 'env>(
Bool(b) => env.context.bool_type().const_int(*b as u64, false).into(),
Byte(b) => env.context.i8_type().const_int(*b as u64, false).into(),
Cond {
branch_symbol,
branching_symbol,
pass: (pass_stores, pass_expr),
fail: (fail_stores, fail_expr),
ret_layout,
@ -186,7 +186,7 @@ pub fn build_expr<'a, 'ctx, 'env>(
let ret_type =
basic_type_from_layout(env.arena, env.context, &ret_layout, env.ptr_bytes);
let cond_expr = load_symbol(env, scope, branch_symbol);
let cond_expr = load_symbol(env, scope, branching_symbol);
match cond_expr {
IntValue(value) => {