summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-10-28 21:38:43 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-10-28 21:38:43 +0000
commit2f0940b6cab766f039dc22d361f52e25b22e9fa8 (patch)
treed828db04d486d7d5da0470af601c3055d195e57f /Python
parentc975b9477b8181db2f9076be43f53ef32397319b (diff)
downloadcpython-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.c5
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;