diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-07-30 19:18:13 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-07-30 19:18:13 (GMT) |
commit | c173b488dcf496e9a09024fbcd1104d72f71d226 (patch) | |
tree | ddc8d88631bcf26c682cff3b4a311afceb16bca0 /Python/ast.c | |
parent | 499b0e638bf0ede8239fe57ed0b2eb76bc04fa49 (diff) | |
download | cpython-c173b488dcf496e9a09024fbcd1104d72f71d226.zip cpython-c173b488dcf496e9a09024fbcd1104d72f71d226.tar.gz cpython-c173b488dcf496e9a09024fbcd1104d72f71d226.tar.bz2 |
Add some asserts and update comments
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c index 9e8d911..ca832aa 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -622,10 +622,10 @@ ast_for_arguments(struct compiling *c, const node *n) } args = (n_args ? asdl_seq_new(n_args, c->c_arena) : NULL); if (!args && n_args) - return NULL; /* Don't need to go to NULL; nothing allocated */ + return NULL; /* Don't need to goto error; no objects allocated */ defaults = (n_defaults ? asdl_seq_new(n_defaults, c->c_arena) : NULL); if (!defaults && n_defaults) - goto error; + return NULL; /* Don't need to goto error; no objects allocated */ /* fpdef: NAME | '(' fplist ')' fplist: fpdef (',' fpdef)* [','] @@ -644,6 +644,7 @@ ast_for_arguments(struct compiling *c, const node *n) expr_ty expression = ast_for_expr(c, CHILD(n, i + 2)); if (!expression) goto error; + assert(defaults != NULL); asdl_seq_SET(defaults, j++, expression); i += 2; found_default = 1; |