codegen: again, a bug regarding BB ordering
authorBernhard Urban <lewurm@gmail.com>
Sat, 16 Jun 2012 21:21:57 +0000 (23:21 +0200)
committerBernhard Urban <lewurm@gmail.com>
Mon, 18 Jun 2012 16:32:49 +0000 (18:32 +0200)
Mate/X86CodeGen.hs

index d09304d70428463ddd400351c27fdf234be83bee..d6198796991290970d7c04dcaf3d3b49291b06e1 100644 (file)
@@ -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