From 019fadfaf181a8cdaa79334de0b1463a725bda42 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 21 Apr 2019 20:39:33 +0200 Subject: Build with newer stack LTS --- Compiler.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Compiler.hs') diff --git a/Compiler.hs b/Compiler.hs index 2e3b80b..69b2fd8 100644 --- a/Compiler.hs +++ b/Compiler.hs @@ -160,7 +160,10 @@ compileProgram (Program values) = runCM $ do switchBlock bnext addIns (RNone, IDiscard ref) setTerm IExit - ([firstbb], otherbbs) <- liftM (partition ((== bstart) . bbId) . Map.elems) (gets csBlocks) + (bbs, otherbbs) <- liftM (partition ((== bstart) . bbId) . Map.elems) (gets csBlocks) + let firstbb = case bbs of + [bb] -> bb + _ -> error "Multiple bb's with the same ID!" funcs <- gets csFunctions datas <- gets csDatas return (IRProgram (firstbb : otherbbs) funcs datas) -- cgit v1.2.3-54-g00ecf