From 359958941d8775bfc97ac8977f2a4d115808c02e Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Thu, 14 Jun 2012 00:09:00 +0200 Subject: [PATCH] codegen: workaround for a emitBB bug --- Mate/X86CodeGen.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Mate/X86CodeGen.hs b/Mate/X86CodeGen.hs index d895d63..e365367 100644 --- a/Mate/X86CodeGen.hs +++ b/Mate/X86CodeGen.hs @@ -322,10 +322,17 @@ emitFromBB method sig cls hmap = do emitIF cond = let sid = case successor bb of TwoTarget _ t -> t; _ -> error "bad" l = getLabel sid lmap - in case cond of - C_EQ -> je l; C_NE -> jne l - C_LT -> jl l; C_GT -> jg l - C_GE -> jge l; C_LE -> jle l + sid2 = case successor bb of TwoTarget t _ -> t; _ -> error "bad" + l2 = getLabel sid2 lmap + in do + case cond of + C_EQ -> je l; C_NE -> jne l + C_LT -> jl l; C_GT -> jg l + C_GE -> jge l; C_LE -> jle l + -- TODO(bernhard): ugly workaround, to get broken emitBB working + -- (it didn't work for gnu/classpath/SystemProperties.java) + jmp l2 + callMalloc :: CodeGen e s () callMalloc = do -- 2.25.1