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 consistency check: unassigned / bad_typed_register #7505

Closed
RobinMorisset opened this issue Jul 19, 2023 · 1 comment
Closed
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@RobinMorisset
Copy link
Contributor

RobinMorisset commented Jul 19, 2023

Describe the bug
Running erlc on the following code:

f() ->
    <<
        0
     || register(
            _V5 =
                ((_V5 = is_list(
                    try [0 || <<_>> <= <<>>] of
                        _ ->
                            "a"
                    catch
                        _ ->
                            ok
                    end
                )) andalso _V5),
            ok
        ),
        _V5
    >>.

results in the following error message:

unassigned:1: function f/0+29:
  Internal consistency check failed - please report this bug.
  Instruction: {test,is_eq_exact,
                     {f,14},
                     [{tr,{x,0},{t_atom,[false,true]}},
                      {tr,{y,1},{t_atom,[false,true]}}]}
  Error:       {unassigned,{y,1}}:

It is possible to minimize the testcase further, but it changes the error message. The following:

f() ->
    _V5 =
        ((_V5 = is_list(
            try now() of
                _ ->
                    "a"
            catch
                _ ->
                    ok
            end
        )) andalso _V5).

leads to the following error:

test961435:1: function f/0+23:
  Internal consistency check failed - please report this bug.
  Instruction: {test,is_eq_exact,
                     {f,14},
                     [{tr,{x,1},{t_atom,[false,true]}},
                      {tr,{x,0},{t_atom,[false,true]}}]}
  Error:       {bad_typed_register,
                   {t_union,
                       {t_atom,[ok]},
                       {t_cons,{t_integer,{52,120}},nil},
                       none,none,none},
                   {t_atom,[false,true]}}:

Affected versions
Both testcases fail with the following:

Only the top testcase (the one with the "unassigned" error message) fails with an old version of OTP 25.

Additional context
This might be a duplicate of #7504 as the two seem quite similar, despite the error message being slightly different.

@RobinMorisset RobinMorisset added the bug Issue is reported as a bug label Jul 19, 2023
@jhogberg jhogberg added team:VM Assigned to OTP team VM stalled waiting for input by the Erlang/OTP team labels Jul 19, 2023
@bjorng bjorng self-assigned this Jul 31, 2023
bjorng added a commit to bjorng/otp that referenced this issue Jul 31, 2023
@bjorng bjorng linked a pull request Jul 31, 2023 that will close this issue
@bjorng
Copy link
Contributor

bjorng commented Jul 31, 2023

Yes, it is the same bug.

@bjorng bjorng removed the stalled waiting for input by the Erlang/OTP team label Jul 31, 2023
@bjorng bjorng closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
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

3 participants