[Commit] nickle ChangeLog,1.99,1.100 execute.c,1.92,1.93

Keith Packard commit at keithp.com
Thu Nov 18 22:53:08 PST 2004


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv5258

Modified Files:
	ChangeLog execute.c 
Log Message:
2004-11-18  Keith Packard  <keithp at keithp.com>

	* examples/sort.5c:
	Change copyright symbol encoding from Latin-1 to UTF-8
	* execute.c: (ThreadArray), (ThreadArrayInd):
	Catch negative array dimensions.
	Bug discovered by James LaMar


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- ChangeLog	15 Nov 2004 20:16:36 -0000	1.99
+++ ChangeLog	19 Nov 2004 06:53:05 -0000	1.100
@@ -1,3 +1,11 @@
+2004-11-18  Keith Packard  <keithp at keithp.com>
+
+	* examples/sort.5c:
+	Change copyright symbol encoding from Latin-1 to UTF-8
+	* execute.c: (ThreadArray), (ThreadArrayInd):
+	Catch negative array dimensions.
+	Bug discovered by James LaMar
+
 2004-11-15  Keith Packard  <keithp at keithp.com>
 
 	* examples/COPYING:

Index: execute.c
===================================================================
RCS file: /local/src/CVS/nickle/execute.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- execute.c	7 Jul 2004 07:32:47 -0000	1.92
+++ execute.c	19 Nov 2004 06:53:05 -0000	1.93
@@ -324,7 +324,12 @@
     dims = AllocateTemp (ndim * sizeof (int));
     for (i = 0; i < ndim; i++)
     {
-	dims[i] = IntPart (Stack(i), "Invalid array dimension");
+	Value	d = Stack(i);
+	dims[i] = IntPart (d, "Invalid array dimension");
+	if (dims[i] < 0)
+	    RaiseStandardException (exception_invalid_argument,
+				    "Negative array dimension", 
+				    2, NewInt (0), d);
 	if (aborting)
 	    RETURN (0);
     }
@@ -343,7 +348,12 @@
     dims = AllocateTemp (ndim * sizeof (int));
     for (i = 0; i < ndim; i++)
     {
-	dims[i] = IntPart (ArrayValueGet(a, i), "Invalid array dimension");
+	Value	d = ArrayValueGet(a, i);
+	dims[i] = IntPart (d, "Invalid array dimension");
+	if (dims[i] < 0)
+	    RaiseStandardException (exception_invalid_argument,
+				    "Negative array dimension", 
+				    2, NewInt (0), d);
 	if (aborting)
 	    RETURN (0);
     }




More information about the Commit mailing list