[gs-cvs] rev 6991 - trunk/gs/lib

dan at ghostscript.com dan at ghostscript.com
Mon Aug 14 15:08:43 PDT 2006


Author: dan
Date: 2006-08-14 15:08:43 -0700 (Mon, 14 Aug 2006)
New Revision: 6991

Modified:
   trunk/gs/lib/gs_init.ps
Log:
Add operand type checks and length checks for the currentmatrix,
identmatrix, and setmatrix operators.  This is done to match
error types expected by the CET.  10-03.ps page 2 tests
currentmatrix.  10-06.ps page 1 tests identmatrix.  10-14.ps
page 2 tests setmatrix.


Modified: trunk/gs/lib/gs_init.ps
===================================================================
--- trunk/gs/lib/gs_init.ps	2006-08-14 12:54:58 UTC (rev 6990)
+++ trunk/gs/lib/gs_init.ps	2006-08-14 22:08:43 UTC (rev 6991)
@@ -380,6 +380,10 @@
     .beginpage
 } odef
 /currentmatrix {
+	dup type /arraytype ne
+	{ /currentmatrix load  /typecheck signalerror } if
+	dup length 6 ne
+	{ /currentmatrix load  /rangecheck signalerror } if
 	.currentmatrix 6 .argindex astore pop
 } odef
 % .currentnumcopies is redefined in Level 2.
@@ -466,8 +470,11 @@
 	  { /errordict .systemvar /handleerror get .internalstopped pop } bind % PLRM standard errorhandling
 	} ifelse def
 /identmatrix [1.0 0.0 0.0 1.0 0.0 0.0] readonly def
-/identmatrix
-	{ dup 0 //identmatrix putinterval } odef
+/identmatrix {
+	dup type /arraytype ne { /identmatrix load  /typecheck signalerror } if
+	dup length 6 ne { /identmatrix load  /rangecheck signalerror } if
+	dup 0 //identmatrix putinterval
+} odef
 /languagelevel 1 def		% gs_lev2.ps may change this
 /makeimagedevice { false makewordimagedevice } odef
 /matrix	{ 6 array identmatrix } odef
@@ -547,6 +554,12 @@
 	.setlinejoin
 } odef
 /setmatrix {
+	dup type /arraytype ne {
+	  dup type /packedarraytype ne {
+	    /setmatrix load  /typecheck signalerror
+	  } if
+	} if
+	dup length 6 ne { /setmatrix load  /rangecheck signalerror } if
 	dup aload pop .setmatrix pop
 } odef
 /showpage {



More information about the gs-cvs mailing list