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

ray at ghostscript.com ray at ghostscript.com
Fri Nov 24 13:13:30 PST 2006


Author: ray
Date: 2006-11-24 13:13:30 -0800 (Fri, 24 Nov 2006)
New Revision: 7223

Modified:
   trunk/gs/src/zarith.c
Log:
Check for rangecheck condition BEFORE doing the divide. Prevent FP exception
on MSVC-6/x86. Fixes problem causing CET 25-09.ps to abort.


Modified: trunk/gs/src/zarith.c
===================================================================
--- trunk/gs/src/zarith.c	2006-11-23 19:01:20 UTC (rev 7222)
+++ trunk/gs/src/zarith.c	2006-11-24 21:13:30 UTC (rev 7223)
@@ -241,11 +241,11 @@
     check_type(op[-1], t_integer);
     if (op->value.intval == 0)
 	return_error(e_undefinedresult);
-    if ((op[-1].value.intval /= op->value.intval) ==
-	MIN_INTVAL && op->value.intval == -1
-	) {			/* Anomalous boundary case, fail. */
+    if ((op[-1].value.intval ==	MIN_INTVAL && op->value.intval == -1) {
+	/* Anomalous boundary case: -MININT / -1, fail. */
 	return_error(e_rangecheck);
     }
+    op[-1].value.intval /= op->value.intval;
     pop(1);
     return 0;
 }



More information about the gs-cvs mailing list