[gs-cvs] rev 6964 - trunk/gs/src

alexcher at ghostscript.com alexcher at ghostscript.com
Fri Aug 4 11:11:09 PDT 2006


Author: alexcher
Date: 2006-08-04 11:11:09 -0700 (Fri, 04 Aug 2006)
New Revision: 6964

Modified:
   trunk/gs/src/zstack.c
Log:
Makes index operator generate stackunderflow rather than rangecheck when 
there's no element on the stack pointed by the argument.



Modified: trunk/gs/src/zstack.c
===================================================================
--- trunk/gs/src/zstack.c	2006-08-04 17:29:08 UTC (rev 6963)
+++ trunk/gs/src/zstack.c	2006-08-04 18:11:09 UTC (rev 6964)
@@ -65,7 +65,7 @@
     register os_ptr opn;
 
     check_type(*op, t_integer);
-    if ((ulong)op->value.intval >= op - osbot) {
+    if ((ulong)op->value.intval >= (ulong)(op - osbot)) {
 	/* Might be in an older stack block. */
 	ref *elt;
 
@@ -73,7 +73,7 @@
 	    return_error(e_rangecheck);
 	elt = ref_stack_index(&o_stack, op->value.intval + 1);
 	if (elt == 0)
-	    return_error(e_rangecheck);
+	    return_error(e_stackunderflow);
 	ref_assign(op, elt);
 	return 0;
     }



More information about the gs-cvs mailing list