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

internal error in erlc: "no function clause matching beam_types:make_integer(0,-1) " #6409

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

Comments

@RobinMorisset
Copy link
Contributor

On master, running erlc on the following file (admittedly not very reasonable):

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

f(<<0:((bnot (1 div 0)))>>)  -> 
	42.

gives the following error message:

Function: f/1
Sub pass ssa_opt_type_start
make_integer.erl: internal error in pass beam_ssa_opt:
exception error: no function clause matching beam_types:make_integer(0,-1) 
  in function  beam_ssa_type:update_types/3 (beam_ssa_type.erl, line 2038)
  in call from beam_ssa_type:simplify/5 (beam_ssa_type.erl, line 1043)
  in call from beam_ssa_type:sig_is/7 (beam_ssa_type.erl, line 309)
  in call from beam_ssa_type:sig_bs/8 (beam_ssa_type.erl, line 251)
  in call from beam_ssa_type:sig_function_1/4 (beam_ssa_type.erl, line 220)
  in call from beam_ssa_type:do_sig_function/4 (beam_ssa_type.erl, line 168)
  in call from beam_ssa_type:sig_function/4 (beam_ssa_type.erl, line 159)

Expected result:
I'd expect erlc to either succeed or fail cleanly, not crash.

@RobinMorisset RobinMorisset added the bug Issue is reported as a bug label Nov 1, 2022
@bjorng bjorng self-assigned this Nov 1, 2022
@bjorng bjorng added the team:VM Assigned to OTP team VM label Nov 1, 2022
bjorng added a commit to bjorng/otp that referenced this issue Nov 1, 2022
@bjorng
Copy link
Contributor

bjorng commented Nov 1, 2022

Thanks! The linked pull request resolves the issue.

bjorng added a commit that referenced this issue Nov 2, 2022
Eliminate compiler crash in the beam_ssa_type pass
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