
4 Mar
2011
4 Mar
'11
8:40 p.m.
1 patch for repository http://darcs.haskell.org/ghc-7.0/packages/old-time: Fri Mar 4 13:05:00 EST 2011 gwright@antiope.com * Fix #4970 (time002 and time004 test failures on darwin) This patch fixes #4970. The tv_usec field of struct timeval has type __int32_t, but getClockTime treats it as 64 bits. Because allocaBytes doesn't zero its memory, garbage can end up in the upper 32 bits. This causes a "picoseconds out of range" error in test002 and test004. The fix is to change the cast of (#peek struct timeval,tv_usec) p_timeval from "IO CTime" to "IO CInt" on darwin. The usec value is then handled correctly. I have no idea why this is only seen when the tests are run interactively but not in compiled code.