Merge remote-tracking branch 'pure11/pure11' into native
commite99851827a8d452bf7fac6e2fd27dd3474d7df37
authorAndy Arvanitis <andyarvanitis@gmail.com>
dateTue 9 May 2017, 23:16 (9 years ago)
parentfa7b69af14293c
src/Language/PureScript/CodeGen/Cpp/Optimizer/Inliner.hs+4−1
@@ -73,7 +73,10 @@ unThunk = everywhereOnCpp convert
7373 convert (CppBlock []) = CppBlock []
7474 convert (CppBlock cpps) =
7575 case last cpps of
76− CppReturn (CppApp (CppLambda _ [] _ (CppBlock body)) []) -> CppBlock $ init cpps ++ body
76+ CppReturn (CppApp (CppLambda _ [] _ (CppBlock body)) []) ->
77+ case last body of
78+ CppReturn _ -> CppBlock $ init cpps ++ [CppIfElse (CppBooleanLiteral True) (CppBlock body) Nothing]
79+ _ -> CppBlock cpps
7780 _ -> CppBlock cpps
7881 convert cpp = cpp
7982