Skip to content

Commit

Permalink
Fix transformation code
Browse files Browse the repository at this point in the history
  • Loading branch information
AnsonYeung committed Jan 23, 2025
1 parent 5beec3c commit 4e2f460
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ class StackSafeTransform(depthLimit: Int)(using State):
case _: FunDefn | _: ValDefn => super.applyDefn(defn)

override def applyBlock(b: Block): Block = b match
case Return(res, implct) if usesStack(res) =>
applyResult2(res): res =>
extract(res, true, Return(_, implct))
case Return(res, implct) if usesStack(res) =>
extract(applyResult(res), true, Return(_, implct))
case _ => super.applyBlock(b)

override def applyResult2(r: Result)(k: Result => Block): Block =
Expand Down
Loading

0 comments on commit 4e2f460

Please sign in to comment.