mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Handle more memory allocation failures without crashing.
This commit is contained in:
parent
33722aec57
commit
d12bd012a6
5 changed files with 38 additions and 8 deletions
|
@ -638,8 +638,10 @@ ast_for_arguments(struct compiling *c, const node *n)
|
|||
anything other than EQUAL or a comma? */
|
||||
/* XXX Should NCH(n) check be made a separate check? */
|
||||
if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
|
||||
asdl_seq_SET(defaults, j++,
|
||||
ast_for_expr(c, CHILD(n, i + 2)));
|
||||
expr_ty expression = ast_for_expr(c, CHILD(n, i + 2));
|
||||
if (!expression)
|
||||
goto error;
|
||||
asdl_seq_SET(defaults, j++, expression);
|
||||
i += 2;
|
||||
found_default = 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue