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

lpd at ghostscript.com lpd at ghostscript.com
Sun Jan 21 18:44:19 PST 2007


Author: lpd
Date: 2007-01-21 18:44:19 -0800 (Sun, 21 Jan 2007)
New Revision: 7630

Modified:
   trunk/gs/src/zupath.c
Log:
Fixes bug (PS3 CET 17-0[1-5]-3): if a user path ended with extra operand
values, they were not popped from the stack.


Modified: trunk/gs/src/zupath.c
===================================================================
--- trunk/gs/src/zupath.c	2007-01-21 17:53:13 UTC (rev 7629)
+++ trunk/gs/src/zupath.c	2007-01-22 02:44:19 UTC (rev 7630)
@@ -592,7 +592,7 @@
 	return_error(e_typecheck);
     check_read(*oppath);
     gs_newpath(igs);
-/****** ROUND tx AND ty ******/
+    /****** ROUND tx AND ty ******/
     
     if ( r_size(oppath) == 2 &&
 	 array_get(imemory, oppath, 1, &opcodes) >= 0 &&
@@ -622,7 +622,7 @@
 	    else {		/* operator */
 		const up_data_t data = up_data[opx];
 
-		*pnargs = data.num_args; /* in case of error */
+		*pnargs = 0;	/* in case of error */
 		if (upath_compat && opx == upath_op_ucache) {
 		    /* CPSI does not complain about incorrect ucache
 		       placement, even though PLRM3 says it's illegal. */
@@ -638,6 +638,7 @@
 
 		    while (opargs--) {
 			push(1);
+			*pnargs++; /* in case of error */
 			code = num_array_get(imemory, &operands, format, i++, op);
 			switch (code) {
 			    case t_integer:
@@ -721,8 +722,10 @@
 		    return_error(e_typecheck);
 	    }
 	}
-	if (argcount)
+	if (argcount) {
+	    *pnargs = argcount;
 	    return_error(e_typecheck);	/* leftover args */
+	}
     }
     if (ups < UPS_SETBBOX)
 	return_error(e_typecheck);	/* no setbbox */



More information about the gs-cvs mailing list