X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mate.git;a=blobdiff_plain;f=Mate%2FX86CodeGen.hs;h=661837f75008b1175f685f7dc058fa69bb0977d2;hp=7d17a9d7314d0f18929f124fdca250909381f9c7;hb=022b945b3f13f7f855fa304fcf0ece0967fa508d;hpb=f10d1bdc437ca6e91890d4f97f1844eacbe418de diff --git a/Mate/X86CodeGen.hs b/Mate/X86CodeGen.hs index 7d17a9d..661837f 100644 --- a/Mate/X86CodeGen.hs +++ b/Mate/X86CodeGen.hs @@ -99,10 +99,9 @@ emitFromBB cls method = do getCurrentOffset :: CodeGen e s Word32 getCurrentOffset = do - ep <- getEntryPoint - let w32_ep = (fromIntegral $ ptrToIntPtr ep) :: Word32 - offset <- getCodeOffset - return $ w32_ep + fromIntegral offset + ep <- (fromIntegral . ptrToIntPtr) `liftM` getEntryPoint + offset <- fromIntegral `liftM` getCodeOffset + return $ ep + offset emitInvoke :: Word16 -> Bool -> CodeGen e s (Maybe (Word32, TrapCause)) emitInvoke cpidx hasThis = do