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

is_record(A, a, 0) crashes erlc #7298

Closed
ilya-klyuchnikov opened this issue May 25, 2023 · 1 comment · Fixed by #7319
Closed

is_record(A, a, 0) crashes erlc #7298

ilya-klyuchnikov opened this issue May 25, 2023 · 1 comment · Fixed by #7319
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@ilya-klyuchnikov
Copy link
Contributor

Describe the bug
Expressions in the form is_record(A, a, 0) crashes erlc.

To Reproduce

-module(rec).
-export([foo/1]).
foo(A) -> is_record(A, a, 0).
erlc rec.erl
Function: foo/1
Sub pass ssa_opt_type_start
rec.erl: internal error in pass beam_ssa_opt:
exception error: no match of right hand side value false
  in function  beam_ssa_type:simplify/2 (beam_ssa_type.erl, line 1283)
  in call from beam_ssa_type:simplify/5 (beam_ssa_type.erl, line 1065)
  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)
  in call from beam_ssa_type:signatures_1/3 (beam_ssa_type.erl, line 147)

Expected behavior
No erlc crash

Affected versions
OTP 26, OTP 25, ...

@ilya-klyuchnikov ilya-klyuchnikov added the bug Issue is reported as a bug label May 25, 2023
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label May 26, 2023
@Shaienn
Copy link
Contributor

Shaienn commented May 27, 2023

Does it make sense with Size == 0?

Eshell V13.2.2  (abort with ^G)
1> size({a}).
1
2> size({}). 
0

@bjorng bjorng self-assigned this May 27, 2023
@bjorng bjorng linked a pull request May 29, 2023 that will close this issue
bjorng added a commit that referenced this issue May 30, 2023
/OTP-18605

Fix is_record/3 for unreasonable tuple sizes
@bjorng bjorng closed this as completed in a8eb23f May 30, 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

Successfully merging a pull request may close this issue.

4 participants