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

alexcher at ghostscript.com alexcher at ghostscript.com
Fri Aug 4 20:17:54 PDT 2006


Author: alexcher
Date: 2006-08-04 20:17:54 -0700 (Fri, 04 Aug 2006)
New Revision: 6969

Modified:
   trunk/gs/src/zarray.c
Log:
Makes astore generate invalidaccess rather than typecheck when
given a packed array.


Modified: trunk/gs/src/zarray.c
===================================================================
--- trunk/gs/src/zarray.c	2006-08-05 02:16:49 UTC (rev 6968)
+++ trunk/gs/src/zarray.c	2006-08-05 03:17:54 UTC (rev 6969)
@@ -89,16 +89,17 @@
 zastore(i_ctx_t *i_ctx_p)
 {
     os_ptr op = osp;
-    uint size = r_size(op);
+    uint size;
     int code;
 
+    if (!r_is_array(op))
+	return_op_typecheck(op);
+    size = r_size(op);
     /* Amazingly, the following is valid: 0 array noaccess astore */
-    if (size == 0) {
-        if (!r_is_array(op))
-	    return_op_typecheck(op);
+    if (size == 0)
         return 0;
-    }
-    check_write_type(*op, t_array);
+    if (!r_has_type_attrs(op, t_array, a_write)) 
+        return_error(e_invalidaccess);
     if (size > op - osbot) {
 	/* The store operation might involve other stack segments. */
 	ref arr;



More information about the gs-cvs mailing list