compiler bug

Bjorn Gustavsson bjorn@REDACTED
Tue May 3 14:15:11 CEST 2005


Yes, it was corrected in R10B-4.

But there will be some more bug fixes in R10B-5. The internal
validation pass (beam_validator) in R10B-4 can in some case
cause an internal error when in the fact the generated code
was correct.

/Bjorn

Dietmar Schaefer <dietmar@REDACTED> writes:

> On the 02/14/05   mbj reported the following compiler bug !
> 
> I just got some quite simillar error !
> 
> 
> Has this bug been fixed for R10B-4
> 
> Dietmar
> 
> 
> 
> Thanks!
> 
> We'll try to fix the bugs for R10B-4.
> 
> /Bjorn
> 
> mbj@REDACTED writes:
> 
> 
> >> Hi,
> >> I've found a bug in the compiler, same in R10B-2 and 3.  Seems to
> >> work
> >> fine in R9.
> >> Run xx:y() and you'll get ** exited: {{badrecord,bar},
> >>             [{xx,x,1},
> >> If e.g. the call to noop is removed it works fine.
> >> While trying to isolate this error into a small example module, I
> >> found another bug.  Compiling zz.erl gives:
> >> zz: function x/1+25:
> >>   Internal consistency check failed - please report this bug.
> >>   Instruction: {get_tuple_element,{y,2},2,{x,0}}
> >>   Error:       {bad_type,{needed,{tuple_element,3}},{actual,{tuple,[2]}}}:
> >> I'm running on linux, normal erlang installation.
> >> /martin
> >> -module(zz).
> >> -compile(export_all).
> >> -record(bar, {status, vs = []}).
> >> y() ->
> >>     x({foo, 1, []}).
> >> get_bar() ->
> >>     #bar{status = 1}.
> >> x(Trans) ->
> >>     {foo, Barno, _} = Trans,
> >>     case get_bar() of
> >> 	Bar when Bar#bar.status /= 2 ->
> >> 	    if 1 == 1 ->
> >> 		    mnesia:dirty_delete({bar, Barno}),
> >> 		    Vs = [1,2] ++ Bar#bar.vs,
> >> 		    Bar33 = Bar#bar{status = 1},
> >> 		    Bar1 = Bar#bar{status = 3,
> >> 				   vs = Vs},
> >> 		    [{payment, Barno}];
> >> 	       true ->
> >> 		    Barno
> >> 	    end;
> >> 	_ ->
> >> 	    Trans
> >>     end.
> >> -module(xx).
> >> -compile(export_all).
> >> -record(bar, {status}).
> >> y() ->
> >>     x({foo, 1}).
> >> get_bar() ->
> >>     #bar{status = 1}.
> >> x(Trans) ->
> >>     {foo, Barno} = Trans,
> >>     case get_bar() of
> >> 	Bar when Bar#bar.status == 1 ->
> >> 	    noop(Bar),
> >> 	    Bar33 = Bar#bar{status = 1},
> >> 	    {ok, Bar33, Barno};
> >> 	_ ->
> >> 	    Trans
> >>     end.
> >> noop(_) ->
> >>     ok.
> >
> 

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



More information about the erlang-questions mailing list