From: Victor Stinner Date: Thu, 4 Mar 2010 21:59:53 +0000 (+0000) Subject: Issue #3299: replace PyObject_DEL() by Py_DECREF() in _sre module to fix a X-Git-Tag: v3.2a1~1569 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5abeafbb0fed2d2034374c38bd36651cdbf550cd;p=python Issue #3299: replace PyObject_DEL() by Py_DECREF() in _sre module to fix a crash in pydebug mode. --- diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 2107b3ade2..d2f7f6e52e 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -727,6 +727,7 @@ class ReTests(unittest.TestCase): long_overflow = 2**128 self.assertRaises(TypeError, re.finditer, "a", {}) self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow]) + self.assertRaises(TypeError, _sre.compile, {}, 0, []) def run_re_tests(): from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR diff --git a/Modules/_sre.c b/Modules/_sre.c index 7b3ee5fe3a..8f3b8cea8a 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -2702,7 +2702,7 @@ _compile(PyObject* self_, PyObject* args) else { Py_ssize_t p_length; if (!getstring(pattern, &p_length, &self->charsize)) { - PyObject_DEL(self); + Py_DECREF(self); return NULL; } }