LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0567-erts-Fix-bug-in-erts_map_from_ks_and_vs.patch of Package erlang (Project home:Ledest:erlang:20)

From e2ca71b6e7172b320b5b171359d53a161383fb19 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Wed, 6 Feb 2019 19:08:25 +0100
Subject: [PATCH] erts: Fix bug in erts_map_from_ks_and_vs

This sleeping bug was introduced in OTP 19.1
but not possible not provoke until OTP 21.0
when enif_make_map_from_arrays was introduced.
---
 erts/emulator/beam/erl_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index 979a0040b0..b48017d338 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -499,7 +499,7 @@ Eterm erts_hashmap_from_array(ErtsHeapFactory* factory, Eterm *leafs, Uint n,
 
 Eterm erts_map_from_ks_and_vs(ErtsHeapFactory *factory, Eterm *ks0, Eterm *vs0, Uint n)
 {
-    if (n < MAP_SMALL_MAP_LIMIT) {
+    if (n <= MAP_SMALL_MAP_LIMIT) {
         Eterm *ks, *vs, *hp;
 	flatmap_t *mp;
 	Eterm keys;
-- 
2.16.4