erlang/otp

internal error in erlc pass beam_ssa_opt

RobinMorisset opened this issue · 0 comments

On master, with the following PR cherry-picked: #6417.
The following code:

-module(no_match_value_false).
-compile([export_all]).

f(X) ->
    case is_atom(X) of
        Y when X ->
            false = Y,
            0
    end.

causes an erlc crash with the following error message:

Function: f/1
Sub pass ssa_opt_type_start
no_match_value_false.erl: internal error in pass beam_ssa_opt:
exception error: no match of right hand side value false
  in function  beam_ssa_type:infer_subtract_types/2 (beam_ssa_type.erl, line 2592)
  in call from beam_ssa_type:infer_types_br_1/3 (beam_ssa_type.erl, line 2451)
  in call from beam_ssa_type:infer_types_br/4 (beam_ssa_type.erl, line 2426)
  in call from beam_ssa_type:update_successors/5 (beam_ssa_type.erl, line 1938)
  in call from beam_ssa_type:sig_bs/8 (beam_ssa_type.erl, line 257)
  in call from beam_ssa_type:sig_function_1/4 (beam_ssa_type.erl, line 220)
  in call from beam_ssa_type:do_sig_function/4 (beam_ssa_type.erl, line 168)
  in call from beam_ssa_type:sig_function/4 (beam_ssa_type.erl, line 159)