mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Backport 52504:
Fix bug #1565514, SystemError not raised on too many nested blocks. It seems like this should be a different error than SystemError, but I don't have any great ideas and SystemError was raised in 2.4 and earlier.
This commit is contained in:
parent
c975b9477b
commit
2f0940b6ca
3 changed files with 37 additions and 1 deletions
|
@ -3738,8 +3738,11 @@ static int
|
|||
compiler_push_fblock(struct compiler *c, enum fblocktype t, basicblock *b)
|
||||
{
|
||||
struct fblockinfo *f;
|
||||
if (c->u->u_nfblocks >= CO_MAXBLOCKS)
|
||||
if (c->u->u_nfblocks >= CO_MAXBLOCKS) {
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"too many statically nested blocks");
|
||||
return 0;
|
||||
}
|
||||
f = &c->u->u_fblock[c->u->u_nfblocks++];
|
||||
f->fb_type = t;
|
||||
f->fb_block = b;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue