[erlang-bugs] R19-rc1: Internal error in beam_type

Ulf Norell ulf.norell@REDACTED
Thu May 19 11:00:34 CEST 2016


On R19 rc1 (OTP-19.0-rc1 tag in git) the following module causes an
internal error when compiled:

-module(bug).

-compile(export_all).

f(pat) ->
  X = case err of
         ok  -> ok;
         err -> external:call(), 0
      end,
  case X of
    ok  -> ok;
    err -> err;
    0   -> bad
  end.

The error is:

bug.erl: internal error in beam_type;
crash reason: {case_clause,
    {'EXIT',
        {function_clause,
            [{beam_type,simplify_select_val_int,
                 [{select,select_val,
                      {x,0},
                      {f,7},
                      [{atom,ok},{f,10},{atom,err},{f,9}]},
                  0],
                 [{file,"beam_type.erl"},{line,169}]},
             {beam_type,simplify_basic_1,3,
                 [{file,"beam_type.erl"},{line,155}]},
             {beam_type,opt,3,[{file,"beam_type.erl"},{line,57}]},
             {beam_type,function,1,[{file,"beam_type.erl"},{line,36}]},
             {beam_type,'-module/2-lc$^0/1-0-',1,
                 [{file,"beam_type.erl"},{line,30}]},
             {beam_type,module,2,[{file,"beam_type.erl"},{line,30}]},
             {compile,'-select_passes/2-anonymous-2-',2,
                 [{file,"compile.erl"},{line,521}]},
             {compile,'-internal_comp/4-anonymous-1-',2,
                 [{file,"compile.erl"},{line,306}]}]}}}

  in function  compile:'-select_passes/2-anonymous-2-'/2 (compile.erl, line
521)
  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line
306)
  in call from compile:fold_comp/3 (compile.erl, line 332)
  in call from compile:internal_comp/4 (compile.erl, line 316)
  in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line
166)

/ Ulf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20160519/89478a07/attachment.htm>


More information about the erlang-bugs mailing list