Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 40227:3608605a74d5 legacy-trunk
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.
Will backport.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sat, 28 Oct 2006 21:19:07 +0000 |
| parents | f5d7de5031aa |
| children | 6a860c81ab7d |
line wrap: on
line diff
--- a/Python/compile.c Sat Oct 28 21:17:51 2006 +0000 +++ b/Python/compile.c Sat Oct 28 21:19:07 2006 +0000 @@ -3131,8 +3131,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;
