LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0399-Fixed-bug-calling-erl_compare_ext-with-terms-contain.patch of Package erlang (Project home:Ledest:erlang:20)

From 7f2efcc8cb3f104e6e3a53b18ce559842450b780 Mon Sep 17 00:00:00 2001
From: Simon Cornish <zl9d97p02@sneakemail.com>
Date: Tue, 14 Aug 2018 21:43:01 -0700
Subject: [PATCH 2/2] Fixed bug calling erl_compare_ext with terms containing
 lists The comparison did not consider the list tail and therefore would
 consider the following pairs of terms equal: {<<1,2,3>>, [901,902], 224} and
 {<<1,2,3>>, [901,902], 228} {a|b} and {a|c}

---
 lib/erl_interface/src/legacy/erl_marshal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index c18067b9bc..932bba43bf 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -1803,7 +1803,7 @@ static int cmp_exe2(unsigned char **e1, unsigned char **e2)
       k = 0;
       while (1) {
 	  if (k++ == min){
-	      if (i == j) return 0;
+	      if (i == j) return compare_top_ext(e1 , e2);
 	      if (i < j) return -1;
 	      return 1;
 	  }
-- 
2.16.4