8000 [erlc] internal error in pass beam_ssa_opt · Issue #9844 · erlang/otp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[erlc] internal error in pass beam_ssa_opt #9844

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

Open
giacomocavalieri opened this issue May 18, 2025 · 1 comment
Open

[erlc] internal error in pass beam_ssa_opt #9844

giacomocavalieri opened this issue May 18, 2025 · 1 comment
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@giacomocavalieri
Copy link

Describe the bug
erlc crashes when ran on this module:

-module(prova).

-export([test/2]).
-export_type([continue/2, option/1]).

-type continue(S, C) :: {stop, S} | {continue, C}.
-type option(V) :: {some, V} | none.

-spec test(fun((integer()) -> option(integer())), integer()) -> integer().
test(Next, Prev) ->
    Decision = case Next(Prev) of
        none -> {stop, none};
        {some, N} -> {continue, {some, N}}
    end,
    Acc = case Decision of
        {stop, {some, X}} -> X;
        {continue, {some, X}} -> X;
        _ -> 1
    end,
    case Decision of
        {continue, {some, New}} -> New;
        _ -> Acc
    end.

Producing the following error message:

Function: test/2
Sub pass ssa_opt_type_continue
Function: test/2
prova.erl: internal error in pass beam_ssa_opt:
exception error: no match of right hand side value any
  in function  beam_ssa_type:simplify/2 (beam_ssa_type.erl, line 1305)
  in call from beam_ssa_type:simplify/5 (beam_ssa_type.erl, line 1089)
  in call from beam_ssa_type:opt_is/8 (beam_ssa_type.erl, line 582)
  in call from beam_ssa_type:opt_bs/8 (beam_ssa_type.erl, line 524)
  in call from beam_ssa_type:do_opt_function/6 (beam_ssa_type.erl, line 502)
  in call from beam_ssa_type:opt_function/6 (beam_ssa_type.erl, line 475)
  in call from beam_ssa_opt:ssa_opt_type_continue/1 (beam_ssa_opt.erl, line 439)
  in call from compile:run_sub_passes_1/3 (compile.erl, line 1212)

Affected versions
I've tested this with Erlang/OTP 27 [erts-15.2.7]

@jhogberg
Copy link
Contributor

Thanks for reporting! This appears related to #6599, and we're still working on that.

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

No branches or pull requests

4 participants
0