Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1138-beam_types-Don-t-break-tuple-type-invarian...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1138-beam_types-Don-t-break-tuple-type-invariant.patch of Package erlang
From 0ee59002ab9a890fbee57d2915b611838a1bf82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Wed, 14 Dec 2022 09:59:29 +0100 Subject: [PATCH] beam_types: Don't break tuple type invariant Be sure not to break the invariant that tuple element types must not be `any`. --- lib/compiler/src/beam_types.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compiler/src/beam_types.erl b/lib/compiler/src/beam_types.erl index 5577fe79d8..a872d69c1b 100644 --- a/lib/compiler/src/beam_types.erl +++ b/lib/compiler/src/beam_types.erl @@ -657,7 +657,10 @@ limit_depth_map(#t_map{}, Depth) when Depth =< 0 -> limit_depth_tuple(#t_tuple{elements=Es0}=T, Depth) -> if Depth > 0 -> - Es = maps:map(fun(_, E) -> limit_depth(E, Depth - 1) end, Es0), + Es = foldl(fun({Index, E0}, Es1) -> + E = limit_depth(E0, Depth - 1), + set_tuple_element(Index, E, Es1) + end, Es0, maps:to_list(Es0)), T#t_tuple{elements=Es}; Depth =< 0 -> #t_tuple{elements=#{}} -- 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