You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
tests: Add test for recursive iternext stack overflow.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# This tests that recursion with iternext doesn't lead to segfault.
|
||||
|
||||
try:
|
||||
x = (1, 2)
|
||||
for i in range(1000):
|
||||
x = enumerate(x)
|
||||
tuple(x)
|
||||
except RuntimeError:
|
||||
print("RuntimeError")
|
||||
|
||||
try:
|
||||
x = (1, 2)
|
||||
for i in range(1000):
|
||||
x = filter(None, x)
|
||||
tuple(x)
|
||||
except RuntimeError:
|
||||
print("RuntimeError")
|
||||
|
||||
try:
|
||||
x = (1, 2)
|
||||
for i in range(1000):
|
||||
x = map(max, x, ())
|
||||
tuple(x)
|
||||
except RuntimeError:
|
||||
print("RuntimeError")
|
||||
|
||||
try:
|
||||
x = (1, 2)
|
||||
for i in range(1000):
|
||||
x = zip(x)
|
||||
tuple(x)
|
||||
except RuntimeError:
|
||||
print("RuntimeError")
|
||||
@@ -0,0 +1,4 @@
|
||||
RuntimeError
|
||||
RuntimeError
|
||||
RuntimeError
|
||||
RuntimeError
|
||||
Reference in New Issue
Block a user