You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-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.
The text was updated successfully, but these errors were encountered:
In the private append pass we track values which could be bitstrings
or a term containing a bitstring to find the operation where the
bitstring is constructed. For the purpose of this description, we call
such a value a potential bitstring.
As tracking potential bitstrings is done without correlating type
checks and flow-control, we can sometimes encounter values which are
not potential bitstrings. In 0bac830
the tracking logic was refined to abort as soon as we detected that a
returned literal could not be on an execution path returning a
potential bitstring. This commit extends the tracking logic to abort
tracking when a potential bitstring is constructed by an operation
which cannot produce a bitstring or a term containing a bitstring.
Closeserlang#7011
Describe the bug:
During compilation of the following module:
the compiler crashes:
To Reproduce
See the example above.
Expected behavior
Compilation should succeed without a crash.
Affected versions
The
master
branch, with or without #7005.The text was updated successfully, but these errors were encountered: