Crash in beam_ssa_private_append
bjorng opened this issue · 1 comments
bjorng commented
Describe the bug:
During compilation of the following module:
-module(bug).
-export([bug/2,id/1]).
bug(V, _) when V ->
<< ok || catch <<(bug(id(ok), ok))/binary>> >>;
bug(_, V) ->
id(ok) bor V.
id(I) ->
I.
the compiler crashes:
$ erlc bug.erl
Sub pass ssa_opt_private_append
bug.erl: internal error in pass beam_ssa_opt:
exception error: no case clause matching {{bif,'bor'},[{b_var,7},{b_var,1}],self}
in function beam_ssa_private_append:track_value_in_fun/6 (beam_ssa_private_append.erl, line 212)
in call from beam_ssa_private_append:private_append/3 (beam_ssa_private_append.erl, line 71)
in call from compile:run_sub_passes_1/3 (compile.erl, line 424)
in call from beam_ssa_opt:run_phases/3 (beam_ssa_opt.erl, line 75)
in call from beam_ssa_opt:module/2 (beam_ssa_opt.erl, line 71)
in call from compile:'-select_passes/2-anonymous-0-'/3 (compile.erl, line 683)
in call from compile:fold_comp/4 (compile.erl, line 410)
in call from compile:internal_comp/5 (compile.erl, line 394)
bug.erl:5:5: Warning: binary construction will fail because of a type mismatch
% 5| << ok || catch <<(bug(id(ok), ok))/binary>> >>;
% | ^
To Reproduce
See the example above.
Expected behavior
Compilation should succeed without a crash.
Affected versions
The master
branch, with or without #7005.
frej commented
Looks like my fault, will take a look.