Skip to content

Compiler crash in pass beam_ssa_opt, sub pass ssa_opt_private_append #6847

Closed
@bjorng

Description

@bjorng

Describe the bug
The compiler crashes like this when compiling the module shown below:

Sub pass ssa_opt_private_append
beam_ssa_private_append_crash.erl: internal error in pass beam_ssa_opt:
exception error: no function clause matching beam_ssa_private_append:patch_literal_term([],[self],5) 
  in function  beam_ssa_private_append:patch_appends_ret/3 (beam_ssa_private_append.erl, line 462)
  in call from beam_ssa_private_append:patch_appends_f/5 (beam_ssa_private_append.erl, line 416)
  in call from beam_ssa_private_append:'-patch_appends/3-anonymous-2-'/3 (beam_ssa_private_append.erl, line 390)
  in call from maps:fold_1/4 (maps.erl, line 416)
  in call from beam_ssa_private_append:private_append/3 (beam_ssa_private_append.erl, line 72)
  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)

To Reproduce
Compile the following module:

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

foo() ->
    <<(bar(ok))/binary>>.

bar(#{}) ->
    [];
bar(_) ->
    <<>>.

Expected behavior
The compilation should succeed.

Affected versions
The current master branch.

Metadata

Metadata

Assignees

Labels

bugIssue is reported as a bugteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions