diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_re.py | 6 |
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 |