-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
codegen bugA bug in the IR emitterA bug in the IR emitter
Description
Example Source
function fac(n, acc) {
console.log("n:", n)
console.log("acc:", acc)
if (n == 0) {
return acc;
}
let value = fac(n - 1, n * acc)
return value
}
console.log(fac(5, 1))
Expected Output
Log: n: 5
Log: acc: 1
Log: n: 4
Log: acc: 5
Log: n: 3
Log: acc: 20
Log: n: 2
Log: acc: 60
Log: n: 1
Log: acc: 120
Log: n: 0
Log: acc: 120
Log: 120
Current Output
Log: n: 5
Log: acc: 1
Log: n: 4
Log: acc: 4
Log: n: 3
Log: acc: 12
Log: n: 2
Log: acc: 24
Log: n: 1
Log: acc: 24
Log: n: 0
Log: acc: 0
<VM hangs and starts allocating a bunch of memory, eventually leading to OOM>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
codegen bugA bug in the IR emitterA bug in the IR emitter