diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-10-28 21:38:43 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-10-28 21:38:43 +0000 |
commit | 2f0940b6cab766f039dc22d361f52e25b22e9fa8 (patch) | |
tree | d828db04d486d7d5da0470af601c3055d195e57f /Python | |
parent | c975b9477b8181db2f9076be43f53ef32397319b (diff) | |
download | cpython-git-2f0940b6cab766f039dc22d361f52e25b22e9fa8.tar.gz |
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.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c index 038bc2f4fe..8be3d79be9 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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; |