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

this code cant compile. Erlang Version is OTP 27(erts-15.0) #8818

Open
xlh1001 opened this issue Sep 18, 2024 · 1 comment · May be fixed by #8838
Open

this code cant compile. Erlang Version is OTP 27(erts-15.0) #8818

xlh1001 opened this issue Sep 18, 2024 · 1 comment · May be fixed by #8838
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@xlh1001
Copy link

xlh1001 commented Sep 18, 2024

Describe the bug
it compiled success in OTP 25, but fail in OTP 27.

To Reproduce

-module(test).
-export([test/3]).
-record(test, {a,b,c}).
-record(test_a, {a,b,c,d,e,f}).

test(Test, Flag, Price) ->
	Data = data:get_test(Test#test.a),
	if
		Data == [] ->
			false;
		true ->
			C = Test#test.c,
			Mina = proplists:get_value(C, Data#test_a.a),
			Maxa = proplists:get_value(C, Data#test_a.b),
			Minc = proplists:get_value(C, Data#test_a.c),
			Maxc = proplists:get_value(C, Data#test_a.d),
			if
				Data#test_a.f == 0 andalso (Flag < Mina * Test#test.b) orelse (Flag > Maxa * Test#test.b) ->
					false;
				(Price < Minc * Test#test.b) orelse (Price > Maxc * Test#test.b) ->
					true;
				true ->
					false
			end
	end.

ERROR:

Function: test/3
Sub pass ssa_opt_type_continue
Function: test/3
src/scene/test.erl: internal error in pass beam_ssa_opt:
exception error: no match of right hand side value #{{b_var,0} => {t_tuple,4,true,#{1 => {t_atom,[test]}}},
  {b_var,1} => any,
  {b_var,2} => any,
  {b_var,23} => #Fun<beam_ssa_type.1.30313043>,
  {b_var,85} => #Fun<beam_ssa_type.1.30313043>,
  {b_var,88} => #Fun<beam_ssa_type.1.30313043>,
  {b_var,98} => #Fun<beam_ssa_type.1.30313043>,
  {b_var,105} => #Fun<beam_ssa_type.1.30313043>,
  {b_var,112} => #Fun<beam_ssa_type.1.30313043>,
  {b_var,119} => #Fun<beam_ssa_type.1.30313043>,
  {b_var,'Data'} => {t_tuple,7,true,#{1 => {t_atom,[test_a]}}},
  {b_var,'Maxa'} => any,
  {b_var,'Maxc'} => any,
  {b_var,'Mina'} => any,
  {b_var,'Minc'} => any}
  in function  beam_ssa_type:concrete_type/2 (beam_ssa_type.erl, line 2482)
  in call from beam_ssa_type:simplify_arg/3 (beam_ssa_type.erl, line 1850)
  in call from beam_ssa_type:'-simplify_args/3-lc$^0/1-0-'/3 (beam_ssa_type.erl, line 1843)
  in call from beam_ssa_type:'-simplify_args/3-lc$^0/1-0-'/3 (beam_ssa_type.erl, line 1843)
  in call from beam_ssa_type:simplify/5 (beam_ssa_type.erl, line 1087)
  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)
@xlh1001 xlh1001 added the bug Issue is reported as a bug label Sep 18, 2024
@jhogberg jhogberg self-assigned this Sep 18, 2024
@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Sep 18, 2024
@jhogberg
Copy link
Contributor

Thanks for your report! I've fixed it in #8838

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