Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit b0ebaeb

Browse files
committed
fix: fix mux to compute both th and el before returning
1 parent d43db17 commit b0ebaeb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/lang/builtins.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ pub fn mux<A, C, TH, EL>(vm: RoundVM, cond: C, th: TH, el: EL) -> (RoundVM, A)
88
EL: Fn(RoundVM) -> (RoundVM, A),
99
{
1010
let (vm_, flag) = cond(vm);
11+
let(th_vm, th_val) = th(vm_);
12+
let(el_vm, el_val) = el(th_vm);
1113
if flag {
12-
th(vm_)
14+
(el_vm, th_val)
1315
} else {
14-
el(vm_)
16+
(el_vm, el_val)
1517
}
1618
}
1719

0 commit comments

Comments
 (0)