R10B-6 compiler bug

Sean Hinde <>
Wed Aug 3 00:09:30 CEST 2005


Hi,

Just came across this one:

-module(compile_bug).
-export([ test/1]).

-record(a, {a,b,c}).

test(As) ->
     case As of
     A when A#a.b == ""; A#a.b == undefined ->
         true;
     _ ->
         false
     end.

23> c(compile_bug).
Function test/1 refers to undefined label 5
./compile_bug.erl:none: internal error in beam_dead;
crash reason: {{case_clause,{'EXIT',{undefined_label,5}}},
                [{compile,'-select_passes/2-anonymous-2-',2},
                 {compile,'-internal_comp/4-anonymous-1-',2},
                 {compile,fold_comp,3},
                 {compile,internal_comp,4},
                 {compile,internal,3}]}
error

The error seems to occur in pass 'beam_bool' - skipping this pass  
avoids creating the error

Another workaround is to use 'or' instead of ';'

Sean



More information about the erlang-questions mailing list