Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
5133-beam_call_types-Fix-success-check-for-bsl....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5133-beam_call_types-Fix-success-check-for-bsl.patch of Package erlang
From 772d1b488cef031909eb3b672899562f3ac11603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org> Date: Thu, 11 May 2023 15:57:22 +0200 Subject: [PATCH] beam_call_types: Fix success check for 'bsl' --- lib/compiler/src/beam_call_types.erl | 2 +- lib/compiler/test/beam_type_SUITE.erl | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/compiler/src/beam_call_types.erl b/lib/compiler/src/beam_call_types.erl index bd1d672d4a..6231ea4436 100644 --- a/lib/compiler/src/beam_call_types.erl +++ b/lib/compiler/src/beam_call_types.erl @@ -56,7 +56,7 @@ will_succeed(erlang, 'bsr', [#t_integer{elements={_,_}}, #t_integer{elements={S,_}}]) when S >= 0 -> yes; -will_succeed(erlang, 'bsl', [#t_integer{}=LHS,#t_integer{elements={S,_}}]) +will_succeed(erlang, 'bsl', [#t_integer{}=LHS,#t_integer{elements={_,S}}]) when S < 64 -> succeeds_if_smallish(LHS); will_succeed(erlang, '++', [LHS, _RHS]) -> diff --git a/lib/compiler/test/beam_type_SUITE.erl b/lib/compiler/test/beam_type_SUITE.erl index aa8f5b5588..71cd78bb3a 100644 --- a/lib/compiler/test/beam_type_SUITE.erl +++ b/lib/compiler/test/beam_type_SUITE.erl @@ -26,7 +26,8 @@ arity_checks/1,elixir_binaries/1,find_best/1, test_size/1,cover_lists_functions/1,list_append/1,bad_binary_unit/1, none_argument/1,success_type_oscillation/1,type_subtraction/1, - container_subtraction/1,is_list_opt/1]). + container_subtraction/1,is_list_opt/1, + will_succeed/1]). %% Force id/1 to return 'any'. -export([id/1]). @@ -59,7 +60,8 @@ groups() -> success_type_oscillation, type_subtraction, container_subtraction, - is_list_opt + is_list_opt, + will_succeed ]}]. init_per_suite(Config) -> @@ -710,5 +712,18 @@ is_list_opt_3(A) -> _ = (Bool = is_list(A)) orelse binary_to_integer(<<"">>), Bool. +will_succeed(_Config) -> + b = will_succeed_1(id(ok), id(#{})), + ok. + +%% OTP-18576: the beam_call_types:will_succeed/3 check was incorrect for 'bsl', +%% erroneously stating that it would never fail in some instances. +will_succeed_1(_V0, _V1) + when (1 bsl ((map_size(_V1) bxor 288230376151711743) + band 288230376151711743)) =:= _V0 -> + a; +will_succeed_1(_, _) -> + b. + id(I) -> I. -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor