From fd11c93bc38a0ba6d62fc39caa5ee5af23bbd029 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Mon, 30 May 2016 17:04:04 +0200
Subject: [PATCH] Runtime [Multisets]: Fixed assertion failure.

Lookup with objects with lfun::`<() et al in non-empty multisets
containing non-comparable items (not objects or functions) could
cause assertion failures.
---
 src/multiset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/multiset.c b/src/multiset.c
index 02a5c8a345..2561c10451 100644
--- a/src/multiset.c
+++ b/src/multiset.c
@@ -1339,7 +1339,8 @@ static union msnode *low_multiset_find_eq (struct multiset *l, struct svalue *ke
 
       if (TYPEOF(msd->cmp_less) == T_INT) {
 	struct svalue tmp;
-	if (!(msd->ind_types & (BIT_OBJECT | BIT_FUNCTION))) {
+	if (!((msd->ind_types | (1 << TYPEOF(*key))) &
+	      (BIT_OBJECT | BIT_FUNCTION))) {
 	  /* Can assume an internal order which defines a total order
 	   * for all values. */
 	  LOW_RB_FIND (
-- 
GitLab