+ emitSigIllTrap :: Int -> CodeGen e s NativeWord
+ emitSigIllTrap traplen = do
+ when (traplen < 2) (error "emitSigIllTrap: trap len too short")
+ trapaddr <- getCurrentOffset
+ -- 0xffff causes SIGILL
+ emit8 (0xff :: Word8); emit8 (0xff :: Word8)
+ -- fill rest up with NOPs
+ sequence_ [nop | _ <- [1 .. (traplen - 2)]]
+ return trapaddr
+