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

alexcher at ghostscript.com alexcher at ghostscript.com
Fri Aug 4 14:43:08 PDT 2006


Author: alexcher
Date: 2006-08-04 14:43:08 -0700 (Fri, 04 Aug 2006)
New Revision: 6966

Modified:
   trunk/gs/src/zarray.c
Log:
Makes astore to a 0-length array valid regardless of the array access status.


Modified: trunk/gs/src/zarray.c
===================================================================
--- trunk/gs/src/zarray.c	2006-08-04 18:28:19 UTC (rev 6965)
+++ trunk/gs/src/zarray.c	2006-08-04 21:43:08 UTC (rev 6966)
@@ -89,11 +89,16 @@
 zastore(i_ctx_t *i_ctx_p)
 {
     os_ptr op = osp;
-    uint size;
+    uint size = r_size(op);
     int code;
 
+    /* Amazingly, the following is valid: 0 array noaccess astore */
+    if (size == 0) {
+        if (!r_is_array(op))
+	    return_op_typecheck(op);
+        return 0;
+    }
     check_write_type(*op, t_array);
-    size = r_size(op);
     if (size > op - osbot) {
 	/* The store operation might involve other stack segments. */
 	ref arr;



More information about the gs-cvs mailing list