[Python-checkins] cpython (merge 3.3 -> default): Issue #16305: Merge fix from 3.3.

mark.dickinson python-checkins at python.org
Thu Oct 25 11:52:28 CEST 2012


http://hg.python.org/cpython/rev/cbdd6852a274
changeset:   79935:cbdd6852a274
parent:      79932:af93948ca33d
parent:      79934:19ed42e84030
user:        Mark Dickinson <mdickinson at enthought.com>
date:        Thu Oct 25 10:48:39 2012 +0100
summary:
  Issue #16305: Merge fix from 3.3.

files:
  Misc/NEWS            |  3 +++
  Modules/mathmodule.c |  7 +++----
  2 files changed, 6 insertions(+), 4 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -62,6 +62,9 @@
 Library
 -------
 
+- Issue #16305: Fix a segmentation fault occurring when interrupting
+  math.factorial.
+
 - Issue #16116: Fix include and library paths to be correct when building C
   extensions in venvs.
 
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1381,14 +1381,13 @@
         Py_DECREF(outer);
         outer = tmp;
     }
-
-    goto done;
+    Py_DECREF(inner);
+    return outer;
 
   error:
     Py_DECREF(outer);
-  done:
     Py_DECREF(inner);
-    return outer;
+    return NULL;
 }
 
 /* Lookup table for small factorial values */

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list