[gs-cvs] rev 6974 - trunk/gs/src
lpd at ghostscript.com
lpd at ghostscript.com
Mon Aug 7 01:38:34 PDT 2006
Author: lpd
Date: 2006-08-07 01:38:34 -0700 (Mon, 07 Aug 2006)
New Revision: 6974
Modified:
trunk/gs/src/zupath.c
Log:
Makes error returns from ineofill (and many other user path operators) match
Adobe interpreters.
Modified: trunk/gs/src/zupath.c
===================================================================
--- trunk/gs/src/zupath.c 2006-08-06 20:36:34 UTC (rev 6973)
+++ trunk/gs/src/zupath.c 2006-08-07 08:38:34 UTC (rev 6974)
@@ -161,6 +161,10 @@
fr.q.y = fr.p.y + fixed_1;
code = gx_clip_to_rectangle(igs, &fr);
npop = 2;
+ } else if (code == e_stackunderflow) {
+ /* If 0 elements, definitely a stackunderflow; otherwise, */
+ /* only 1 number, also a stackunderflow. */
+ return code;
} else { /* Aperture is a user path. */
/* We have to set the clipping path without disturbing */
/* the current path. */
@@ -552,11 +556,13 @@
upath_state ups = UPS_INITIAL;
ref opcodes;
+ if (r_has_type(oppath, t__invalid))
+ return_error(e_stackunderflow);
+ if (!r_is_array(oppath))
+ return_error(e_typecheck);
check_read(*oppath);
gs_newpath(igs);
/****** ROUND tx AND ty ******/
- if (!r_is_array(oppath))
- return_error(e_typecheck);
if ( r_size(oppath) == 2 &&
array_get(imemory, oppath, 1, &opcodes) >= 0 &&
@@ -639,12 +645,10 @@
*op = rup;
break;
case t_name:
- if (!r_has_attr(&rup, a_executable))
- return_error(e_typecheck);
- if (dict_find(systemdict, &rup, &defp) <= 0)
- return_error(e_undefined);
- if (r_btype(defp) != t_operator)
- return_error(e_typecheck);
+ if (!r_has_attr(&rup, a_executable) ||
+ dict_find(systemdict, &rup, &defp) <= 0 ||
+ r_btype(defp) != t_operator)
+ return_error(e_typecheck); /* all errors = typecheck */
goto xop;
case t_operator:
defp = &rup;
@@ -674,6 +678,8 @@
if (argcount)
return_error(e_typecheck); /* leftover args */
}
+ if (ups != UPS_PATH)
+ return_error(e_typecheck); /* no setbbox */
return 0;
}
private int
More information about the gs-cvs
mailing list