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

lpd at ghostscript.com lpd at ghostscript.com
Sun Jul 30 19:38:14 PDT 2006


Author: lpd
Date: 2006-07-30 19:38:14 -0700 (Sun, 30 Jul 2006)
New Revision: 6935

Modified:
   trunk/gs/src/ztype.c
Log:
Makes gs match the behavior of Adobe interpreters, which allow executing
noaccess on a readonly or noaccess dictionary, even though Red Book 3 says
that changing the access of a read-only dictionary is not allowed.  Fixes a
"failure" in Genoa PS3 CET 24-09.



Modified: trunk/gs/src/ztype.c
===================================================================
--- trunk/gs/src/ztype.c	2006-07-28 06:22:57 UTC (rev 6934)
+++ trunk/gs/src/ztype.c	2006-07-31 02:38:14 UTC (rev 6935)
@@ -184,16 +184,14 @@
 
     check_op(1);
     if (r_has_type(op, t_dictionary)) {
+	/* Don't allow removing read access to permanent dictionaries. */
+	if (dict_is_permanent_on_dstack(op))
+	    return_error(e_invalidaccess);
 	/*
-	 * Setting noaccess on a read-only dictionary is an attempt to
-	 * change its value, which is forbidden (this is a subtle
-	 * point confirmed with Adobe).  Also, don't allow removing
-	 * read access to permanent dictionaries.
+	 * Even though Red Book 3 says that changing the access of a
+	 * read-only dictionary is not allowed, Adobe interpreters allow
+	 * executing noaccess on a readonly or noaccess dictionary.
 	 */
-	if (dict_is_permanent_on_dstack(op) ||
-	    !r_has_attr(dict_access_ref(op), a_write)
-	    )
-	    return_error(e_invalidaccess);
     }
     return access_check(i_ctx_p, 0, true);
 }



More information about the gs-cvs mailing list