X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Mate%2FX86CodeGen.hs;h=5674523f9cb8fb90bad456510abb0bd0eb51ec60;hb=a6e23e6cdfff068398a0e50bcd757832554effb5;hp=661837f75008b1175f685f7dc058fa69bb0977d2;hpb=022b945b3f13f7f855fa304fcf0ece0967fa508d;p=mate.git diff --git a/Mate/X86CodeGen.hs b/Mate/X86CodeGen.hs index 661837f..5674523 100644 --- a/Mate/X86CodeGen.hs +++ b/Mate/X86CodeGen.hs @@ -63,7 +63,7 @@ emitFromBB cls method = do hmap = rawMapBB method getLabel :: BlockID -> [(BlockID, Label)] -> Label - getLabel _ [] = error "label not found!" + getLabel bid [] = error $ "label " ++ show bid ++ " not found" getLabel i ((x,l):xs) = if i==x then l else getLabel i xs efBB :: (BlockID, BasicBlock) -> TrapMap -> BBStarts -> [(BlockID, Label)] -> CodeGen e s (TrapMap, BBStarts) @@ -99,8 +99,8 @@ emitFromBB cls method = do getCurrentOffset :: CodeGen e s Word32 getCurrentOffset = do - ep <- (fromIntegral . ptrToIntPtr) `liftM` getEntryPoint - offset <- fromIntegral `liftM` getCodeOffset + ep <- (fromIntegral . ptrToIntPtr) <$> getEntryPoint + offset <- fromIntegral <$> getCodeOffset return $ ep + offset emitInvoke :: Word16 -> Bool -> CodeGen e s (Maybe (Word32, TrapCause)) @@ -226,6 +226,7 @@ emitFromBB cls method = do emit' ATHROW = do trapaddr <- emitSigIllTrap 2 let patcher resp reip = do + error "no athrow for you, sorry" emitSigIllTrap 2 return reip return $ Just (trapaddr, ThrowException patcher)