erlang/otp

[erlc] internal error in pass beam_ssa_opt, sub pass ssa_opt_type_continue

RobinMorisset opened this issue · 2 comments

On master:

f() ->
    <<0 || ((0 rem 0) > [0 || _ <- catch (node())]), _ <- []>>.

crashes erlc with the error message:

Sub pass ssa_opt_type_continue
Function: '-f/0-lbc$^1/2-1-'/2
minimized/ssa_opt.erl: internal error in pass beam_ssa_opt:
exception error: no function clause matching beam_types:join([]) 
  in function  beam_ssa_type:join_arg_types/3 (beam_ssa_type.erl, line 453)
  in call from beam_ssa_type:opt_continue/4 (beam_ssa_type.erl, line 436)
  in call from beam_ssa_opt:ssa_opt_type_continue/1 (beam_ssa_opt.erl, line 433)
  in call from compile:run_sub_passes_1/3 (compile.erl, line 422)
  in call from beam_ssa_opt:phase/4 (beam_ssa_opt.erl, line 114)
  in call from beam_ssa_opt:fixpoint/6 (beam_ssa_opt.erl, line 97)
  in call from beam_ssa_opt:run_phases/3 (beam_ssa_opt.erl, line 83)

Here is a different (but quite similar) testcase with the same error message, in case it helps with debugging:

f() ->
    X = self() + 0,
    [
        0
     || [0 || _ <- date()] =< X,
        _ <- []
    ].

Thanks for your report, I've fixed this and #6578 in #6582 :)