Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[erlc] internal error in pass beam_kernel_to_ssa (fun expression with convoluted scoping) #6515

Closed
RobinMorisset opened this issue Nov 25, 2022 · 0 comments · Fixed by #6517
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@RobinMorisset
Copy link
Contributor

On master, the following test case crashes erlc:

f() ->
    {
        (case [] of
            #{} ->
                X = 0;
            X ->
                0
        end),
        fun X() ->
            X
        end
    }.

with the following error message:

Function: f/0
minimized/kernel.erl: internal error in pass beam_kernel_to_ssa:
exception error: bad key: 'X'
  in function  map_get/2
     called as map_get('X',#{0 => {b_var,0},'@ssa_ret' => {b_var,'@ssa_ret'}})
     *** argument 1: not present in map
  in call from beam_kernel_to_ssa:ssa_arg/2 (beam_kernel_to_ssa.erl, line 1127)
  in call from beam_kernel_to_ssa:'-internal_cg/5-lc$^0/1-0-'/2 (beam_kernel_to_ssa.erl, line 1125)
  in call from beam_kernel_to_ssa:'-internal_cg/5-lc$^0/1-0-'/2 (beam_kernel_to_ssa.erl, line 1125)
  in call from beam_kernel_to_ssa:internal_cg/5 (beam_kernel_to_ssa.erl, line 1125)
  in call from beam_kernel_to_ssa:cg/2 (beam_kernel_to_ssa.erl, line 113)
  in call from beam_kernel_to_ssa:do_match_cg/3 (beam_kernel_to_ssa.erl, line 167)
  in call from beam_kernel_to_ssa:cg_fun/2 (beam_kernel_to_ssa.erl, line 91)
@RobinMorisset RobinMorisset added the bug Issue is reported as a bug label Nov 25, 2022
@bjorng bjorng self-assigned this Nov 26, 2022
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Nov 28, 2022
bjorng added a commit that referenced this issue Nov 30, 2022
Fix compiler crash for named fun expression with convoluted scoping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants