From 06f611d96d89247a09f43dcee3a1bec45e84bdbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Thu, 27 Jan 2000 15:14:46 -0800
Subject: [PATCH] implemented (multiset)array

Rev: src/opcodes.c:1.71
---
 src/opcodes.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/opcodes.c b/src/opcodes.c
index 57b0baa9b0..7872f6ca57 100644
--- a/src/opcodes.c
+++ b/src/opcodes.c
@@ -26,7 +26,7 @@
 #include "bignum.h"
 #include "operators.h"
 
-RCSID("$Id: opcodes.c,v 1.70 1999/12/22 00:35:33 grubba Exp $");
+RCSID("$Id: opcodes.c,v 1.71 2000/01/27 23:14:46 hubbe Exp $");
 
 void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)
 {
@@ -153,6 +153,18 @@ void o_cast(struct pike_string *type, INT32 run_time_type)
       case T_MIXED:
 	return;
 
+      case T_MULTISET:
+	switch(sp[-1].type)
+	{
+	  case T_ARRAY:
+	    f_mkmultiset(1);
+	    break;
+
+	  default:
+	    error("Cannot cast %s to multiset.\n",get_name_of_type(sp[-1].type));
+	}
+	break;
+	
       case T_MAPPING:
 	switch(sp[-1].type)
 	{
@@ -563,7 +575,7 @@ void o_cast(struct pike_string *type, INT32 run_time_type)
 #ifdef PIKE_DEBUG
 	  struct svalue *save_sp=sp+1;
 #endif
-	  push_mapping(m=allocate_mapping(tmp->size));
+	  push_mapping(m=allocate_mapping(m_sizeof(tmp)));
 	  
 	  SET_CYCLIC_RET(m);
 	  
-- 
GitLab