Commit a5800231 authored by Luca Bataillard's avatar Luca Bataillard
Browse files

fix hoisting by adding new funs to hoisted set

parent f59f255c
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment