mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
8ad64aaacc
commit
f8d403dd97
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue