Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang
0548-dialyzer-Fix-a-bug-affecting-keyfind-keyse...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0548-dialyzer-Fix-a-bug-affecting-keyfind-keysearch-keyme.patch of Package erlang
From b3c8e94dd0eae8a01fd4513eff3c2f3741dad193 Mon Sep 17 00:00:00 2001 From: Hans Bolinder <hasse@erlang.org> Date: Fri, 8 Feb 2019 14:15:11 +0100 Subject: [PATCH] dialyzer: Fix a bug affecting keyfind/keysearch/keymember --- .../test/small_SUITE_data/src/lists_key_bug.erl | 19 +++++++++++++++++++ lib/hipe/cerl/erl_bif_types.erl | 6 +----- 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl diff --git a/lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl b/lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl new file mode 100644 index 0000000000..d7cbc27a4d --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl @@ -0,0 +1,19 @@ +-module(lists_key_bug). + +%% OTP-15570 + +-export([t/1]). + +t(V) -> + K = key(V), + case lists:keyfind(K, 1, [{<<"foo">>, bar}]) of + false -> + a; + {_, _} -> + b + end. + +key(1) -> + 3; +key(2) -> + <<"foo">>. diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 48ce641ab9..799957dfdc 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -2224,11 +2224,7 @@ type_order() -> [t_number(), t_atom(), t_reference(), t_fun(), t_port(), t_pid(), t_tuple(), t_map(), t_list(), t_bitstr()]. -key_comparisons_fail(X0, KeyPos, TupleList, Opaques) -> - X = case t_is_number(t_inf(X0, t_number(), Opaques), Opaques) of - false -> X0; - true -> t_number() - end, +key_comparisons_fail(X, KeyPos, TupleList, Opaques) -> lists:all(fun(Tuple) -> Key = type(erlang, element, 2, [KeyPos, Tuple]), t_is_none(t_inf(Key, X, Opaques)) -- 2.16.4
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