diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-10-28 21:19:07 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-10-28 21:19:07 +0000 |
commit | 21997afb0c764d5eb50dbe52249d838a597c0a08 (patch) | |
tree | e118a87953cd76f730255d9f3cb9e3017a219068 /Python/compile.c | |
parent | 97a57220e8cfd857c7f46ec9d71f9f841c241fa8 (diff) | |
download | cpython-git-21997afb0c764d5eb50dbe52249d838a597c0a08.tar.gz |
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.
Diffstat (limited to 'Python/compile.c')
-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 374cf1c4ef..939c5edd0e 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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; |