diff Objects/longobject.c @ 24765:4cafd9dbc8b4 legacy-trunk

k_mul(): Moved an assert down. In a debug build, interrupting a multiply via Ctrl+C could cause a NULL-pointer dereference due to the assert.
author Tim Peters <tim.peters@gmail.com>
date Mon, 12 Aug 2002 19:43:49 +0000
parents f0bd5cd4b170
children 801a44ab2aae
line wrap: on
line diff
--- a/Objects/longobject.c	Mon Aug 12 19:38:01 2002 +0000
+++ b/Objects/longobject.c	Mon Aug 12 19:43:49 2002 +0000
@@ -1722,14 +1722,14 @@
 	bh = bl = NULL;
 
 	t3 = k_mul(t1, t2);
-	assert(t3->ob_size >= 0);
 	Py_DECREF(t1);
 	Py_DECREF(t2);
 	if (t3 == NULL) goto fail;
+	assert(t3->ob_size >= 0);
 
 	/* Add t3.  Caution:  t3 can spill one bit beyond the allocated
 	 * result space; it's t3-al*bl-ah*bh that always fits.  We have
-	 * to arrange to ignore the hight bit.
+	 * to arrange to ignore the high bit.
 	 */
 	if (t3->ob_size > i) {
 		assert(t3->ob_size == i+1);	/* just one digit over */