Skip to content

Commit

Permalink
when tail call, we can share a continuation for returning
Browse files Browse the repository at this point in the history
  • Loading branch information
butterunderflow committed Oct 21, 2024
1 parent a48004c commit b6474eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/wasm/MiniWasm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ object Evaluator {
// We push newK on the trail since function creates a new block to escape
// (more or less like `return`)
if (isTail)
eval(body, List(), newFrame, newK, List(newK))
eval(body, List(), newFrame, kont, List(kont))
else
eval(body, List(), newFrame, newK, List(newK))
case Import("console", "log", _) =>
Expand Down

0 comments on commit b6474eb

Please sign in to comment.