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.
This commit is contained in:
Neal Norwitz 2006-10-28 21:19:07 +00:00
parent 97a57220e8
commit 21997afb0c
3 changed files with 37 additions and 1 deletions

View file

@ -3131,8 +3131,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;