compiler bug

Martin Bjorklund mbj@REDACTED
Thu Apr 29 13:32:44 CEST 2004


Hi,

Found this on R9B and R9C.  Maybe known already...

Consider this module:


-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