Skip to content
Snippets Groups Projects
Commit a5800231 authored by Luca Bataillard's avatar Luca Bataillard
Browse files

fix hoisting by adding new funs to hoisted set

parent f59f255c
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,7 @@ object CPSHoister extends (Tree => LetF) {
.unzip
val LetF(funsHoistedBody, hoistedBody) = apply(body)
val funsHoistedFlat = (funsHoistedCnts :+ funsHoistedBody).flatten
val funsHoistedFlat = funsHoistedCnts.flatten ++ funsHoistedBody
LetF(funsHoistedFlat, LetC(newCnts, hoistedBody))
case LetF(funs, body) =>
......@@ -27,7 +26,7 @@ object CPSHoister extends (Tree => LetF) {
}.unzip
val LetF(funsHoistedBody, hoistedBody) = apply(body)
val funsHoistedFlat = (funsHoistedFuns :+ funsHoistedBody).flatten
val funsHoistedFlat = newFuns ++ funsHoistedFuns.flatten ++ funsHoistedBody
LetF(funsHoistedFlat, hoistedBody)
case e => LetF(Seq(), e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment