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] Consistency check failure related to -0.0/+0.0: "bad_arg_type" #7901

Closed
RobinMorisset opened this issue Nov 23, 2023 · 1 comment · Fixed by #7902
Closed

[erlc] Consistency check failure related to -0.0/+0.0: "bad_arg_type" #7901

RobinMorisset opened this issue Nov 23, 2023 · 1 comment · Fixed by #7902
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@RobinMorisset
Copy link
Contributor

Describe the bug
Running erlc on the following code:

-export([start/0]).

f1()  -> 
	f6(catch (true = ok), -0.0).

f3()  -> 
	f6(ok, 0.0).

f6(_, _)  -> 
	ok.

start()  -> 
	f1(),
	f3(),
	f6(ok, ok).

Results in the following error:

test745_mini:1: function f1/0+12:
  Internal consistency check failed - please report this bug.
  Instruction: {call_last,2,{f,8},1}
  Error:       {bad_arg_type,{x,1},
                             {t_float,{-0.0,-0.0}},
                             {t_union,{t_atom,[ok]},
                                      none,
                                      {t_float,{0.0,0.0}},
                                      none,none}}:

Affected versions
master

Additional context
It looks possibly related to #7168 and the OTP 27 change that will make +0.0 =:= -0.0 return false.

@RobinMorisset RobinMorisset added the bug Issue is reported as a bug label Nov 23, 2023
@jhogberg jhogberg self-assigned this Nov 23, 2023
@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Nov 23, 2023
@RobinMorisset
Copy link
Contributor Author

A slightly simpler testcase:

-export([start/0]).

f1(_) ->
    ok.

f4() ->
    f1(0.0).

f8() ->
    f1(-0.0).

start() ->
    f1(ok),
    f4(),
    f8().

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.

2 participants