Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 40233:9acc1775d571 2.5
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.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sat, 28 Oct 2006 21:38:43 +0000 |
| parents | 9e0431fd674a |
| children | be68da561dcd |
line wrap: on
line diff
--- a/Python/compile.c Sat Oct 28 21:37:42 2006 +0000 +++ b/Python/compile.c Sat Oct 28 21:38:43 2006 +0000 @@ -3738,8 +3738,11 @@ 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;
