unsafeShift operations for Data.Bits

Donald Bruce Stewart dons at cse.unsw.edu.au
Fri Nov 10 02:56:23 EST 2006


roconnor:
> On Fri, 10 Nov 2006, Donald Bruce Stewart wrote:
> 
> >>uncheckedFoo - under certain conditions that arn't checked for, this
> >>routine may produce well defined, but unspecified behavior. (as in, the
> >>behavior might depend on something compiler or architecture specific)
> >
> >   uncheckedShift
> >   uncheckedRead/Write
> 
> Doesn't a uncheckedRead/Write potentially crash my machine and/or 
> overwrite arbitrary points of memory?  It seems like at least 
> unwiseunsafeWrite could break the dynamic semantics by breaking the static 
> semantics in a random and machine dependent way.  And still a 
> uncheckedRead can segfault my machine.  I submit that any instruction that 
> can segfault my machine is unsafe.

:)

-- Don


More information about the Libraries mailing list