[racket-dev] Potential Constant Propagation Bug

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Mar 29 16:26:58 EDT 2013

Yes, this is clearly a bug.

At Fri, 29 Mar 2013 16:21:49 -0400, Vincent St-Amour wrote:
> 
> I have found what I think may be a bug in Racket's constant propagation:
> 
>    (unsafe-fx* 0 (error 'foo))
> 
> does not throw and error and evaluates to 0. If 0 is replaced with
> another value, or if it's `read' in, the error is thrown.
> `unsafe-fxquotient' has the same issue.
> 
> On the one hand, this is an unsafe operation, so maybe I shouldn't
> expect the error to be thrown. On the other hand, I would expect
> effectful arguments to functions to be evaluated no matter what.
> 
> Is this a bug, or is this the desired behavior for unsafe operations?
> 
> Vincent
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev

Posted on the dev mailing list.