diff --git a/src/opcodes.c b/src/opcodes.c
index 70bbd113477af91a3eea86043cb20eec6604b629..020f656a795d38de7d4084346ed114435f93f8eb 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.92 2000/11/12 10:18:49 sigge Exp $");
+RCSID("$Id: opcodes.c,v 1.93 2000/11/24 05:41:02 mast Exp $");
 
 void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)
 {
@@ -328,6 +328,9 @@ void o_cast(struct pike_string *type, INT32 run_time_type)
 		  shift = 1;
 		  if (val > 0xffff) {
 		    shift = 2;
+		    while(i--)
+		      if (a->item[i].type != T_INT)
+			error("cast: Item %d is not an integer.\n", i);
 		    break;
 		  }
 		  while(i--) {
@@ -337,6 +340,9 @@ void o_cast(struct pike_string *type, INT32 run_time_type)
 		    val = (unsigned INT32)a->item[i].u.integer;
 		    if (val > 0xffff) {
 		      shift = 2;
+		      while(i--)
+			if (a->item[i].type != T_INT)
+			  error("cast: Item %d is not an integer.\n", i);
 		      break;
 		    }
 		  }