summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-12-11 20:12:40 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-12-11 20:12:40 (GMT)
commitf8d403dd972a354fadc939d54dc0a1c45ffda327 (patch)
tree13fd4898edc4b4ada740831a9b280320f5b00da1 /Lib
parent8ad64aaacc22d68d6d93c3c12f7e67e9962de09b (diff)
downloadcpython-f8d403dd972a354fadc939d54dc0a1c45ffda327.zip
cpython-f8d403dd972a354fadc939d54dc0a1c45ffda327.tar.gz
cpython-f8d403dd972a354fadc939d54dc0a1c45ffda327.tar.bz2
SF #1377897, Bus error in ast
If a line had multiple semi-colons and ended with a semi-colon, we would loop too many times and access a NULL node. Exit the loop early if there are no more children.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_grammar.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 820fab5..aa76b44 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -276,6 +276,10 @@ check_syntax("lambda x: x = 2")
### simple_stmt: small_stmt (';' small_stmt)* [';']
print 'simple_stmt'
x = 1; pass; del x
+def foo():
+ # verify statments that end with semi-colons
+ x = 1; pass; del x;
+foo()
### small_stmt: expr_stmt | print_stmt | pass_stmt | del_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
# Tested below