compiler bug

Tony Rogvall tony@REDACTED
Mon May 3 10:40:55 CEST 2004


On Thu, 2004-04-29 at 13:32, Martin Bjorklund wrote:
> Hi,
> 
> Found this on R9B and R9C.  Maybe known already...
> 
> Consider this module:
> 
> 
Hello ? Hello ?

Any one? Is there a patch? this looks like serious stuff!

/Tony


> -module(x).
> -compile(export_all).
> 
> -record(state, {ena = true}).
> 
> y() ->
>     spawn_link(?MODULE, loop, [#state{}]).
> 
> loop(S) ->
>     receive
> 	_ when S#state.ena == false ->
> 	    io:format("here 1\n"),
> 	    loop(S);
> 	test ->
> 	    io:format("here 2\n"),
> 	    loop(S);
> 	X ->
> 	    io:format("here 3 ~p\n", [X]),
> 	    loop(S)
>     end.
> 
> Sending 'test' to this process should print "here 2".  But:
> 
> 9> P=x:y().     
> <0.53.0>
> 10> P ! test.
> here 3 true
> test
> 
> 
> NOTE that the X argument has been bound to the value of 'ena' in the
> record!  If you look at the x.S file, you'll see the problem...
> 
> 
> /martin
> 
> 
> 
> 
> 




More information about the erlang-questions mailing list