compiler bug

Bjorn Gustavsson <>
Mon May 3 11:57:58 CEST 2004


I've found the bug and I have a preliminary correction.

There will be a patch for the commercial customers first,
and then the correction will be included in OTP-R9C-1.

/Bjorn

Tony Rogvall <> writes:

> 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
> > 
> > 
> > 
> > 
> > 
> 

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list