Skip to content

Commit 8e0b9f4

Browse files
committed
tests/extmod: Add test for ure regexes leading to infinite recursion.
These now should be caught properly and lead to RuntimeError instead of crash.
1 parent aba1f91 commit 8e0b9f4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

tests/extmod/ure_stack_overflow.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
try:
2+
import ure as re
3+
except ImportError:
4+
try:
5+
import re
6+
except ImportError:
7+
print("SKIP")
8+
raise SystemExit
9+
10+
try:
11+
re.match("(a*)*", "aaa")
12+
except RuntimeError:
13+
print("RuntimeError")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RuntimeError

0 commit comments

Comments
 (0)