From aa0c59209b67bb291a5baa5e944beae0e29722cd Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Sat, 16 Jun 2012 23:21:57 +0200 Subject: [PATCH] codegen: again, a bug regarding BB ordering --- Mate/X86CodeGen.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mate/X86CodeGen.hs b/Mate/X86CodeGen.hs index d09304d..d619879 100644 --- a/Mate/X86CodeGen.hs +++ b/Mate/X86CodeGen.hs @@ -78,7 +78,10 @@ emitFromBB method sig cls hmap = do let calls' = calls `M.union` M.fromList (catMaybes cs) case successor bb of Return -> return (calls', bbstarts') - FallThrough t -> efBB (t, hmap M.! t) calls' bbstarts' lmap + FallThrough t -> do + -- TODO(bernhard): le dirty hax. see java/lang/Integer.toString(int, int) + jmp (getLabel t lmap) + efBB (t, hmap M.! t) calls' bbstarts' lmap OneTarget t -> efBB (t, hmap M.! t) calls' bbstarts' lmap TwoTarget t1 t2 -> do (calls'', bbstarts'') <- efBB (t1, hmap M.! t1) calls' bbstarts' lmap -- 2.25.1