summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-14 17:37:24 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-14 17:37:24 (GMT)
commit0560e8a8f8e737688a377a0e934a892100fa19d0 (patch)
treedbdb85da00db2f21623eb77c6cf954da00c6fa89 /Lib
parent9000c1614d183345165271c42926da80102a2a36 (diff)
downloadcpython-0560e8a8f8e737688a377a0e934a892100fa19d0.zip
cpython-0560e8a8f8e737688a377a0e934a892100fa19d0.tar.gz
cpython-0560e8a8f8e737688a377a0e934a892100fa19d0.tar.bz2
Merged revisions 77501 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77501 | antoine.pitrou | 2010-01-14 18:34:48 +0100 (jeu., 14 janv. 2010) | 10 lines Merged revisions 77499 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77499 | antoine.pitrou | 2010-01-14 18:25:24 +0100 (jeu., 14 janv. 2010) | 4 lines Issue #3299: Fix possible crash in the _sre module when given bad argument values in debug mode. Patch by Victor Stinner. ........ ................
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_re.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 383b56a..7ef57e1 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -696,6 +696,12 @@ class ReTests(unittest.TestCase):
self.assertRaises(ValueError, re.compile, '(?a)\w', re.UNICODE)
self.assertRaises(ValueError, re.compile, '(?au)\w')
+ def test_dealloc(self):
+ # issue 3299: check for segfault in debug build
+ import _sre
+ long_overflow = sys.maxsize + 2
+ self.assertRaises(TypeError, re.finditer, "a", {})
+ self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
def run_re_tests():
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR