Hi,

the py3k debug build has been broken in Cython's integration tests for a couple of weeks now due to a use-after-decref bug. Here's the fix, please apply.

BTW, is there a reason unicode_subtype_new() copies the buffer of the unicode object it just created, instead of just stealing it?

Stefan
# HG changeset patch
# User Stefan Behnel <stefan...@behnel.de>
# Date 1319258140 -7200
# Node ID bbd4261e770df456ce35784343a4f7426ce2a642
# Parent  c1effa2cdd20897bcda6a501a022b3b800a69a11
fix use-after-decref crash bug in setup code for unicode subtypes in pydebug mode

diff -r c1effa2cdd20 -r bbd4261e770d Objects/unicodeobject.c
--- a/Objects/unicodeobject.c	Thu Oct 20 23:54:17 2011 +0200
+++ b/Objects/unicodeobject.c	Sat Oct 22 06:35:40 2011 +0200
@@ -13826,11 +13826,11 @@
 
     Py_MEMCPY(data, PyUnicode_DATA(unicode),
               kind * (length + 1));
-    Py_DECREF(unicode);
     assert(_PyUnicode_CheckConsistency(self, 1));
 #ifdef Py_DEBUG
     _PyUnicode_HASH(self) = _PyUnicode_HASH(unicode);
 #endif
+    Py_DECREF(unicode);
     return (PyObject *)self;
 
 onError:
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to