diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-02-19 15:33:10 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-02-19 15:33:10 (GMT) |
commit | 17820c4f1b4726b04360f22d515b44b3a755a55d (patch) | |
tree | a61dc810edba69b34964ba0093e6c5795e8b9d04 | |
parent | b6a442539284448b052597a0733c7308ed8b1d01 (diff) | |
download | cpython-17820c4f1b4726b04360f22d515b44b3a755a55d.zip cpython-17820c4f1b4726b04360f22d515b44b3a755a55d.tar.gz cpython-17820c4f1b4726b04360f22d515b44b3a755a55d.tar.bz2 |
Tolerate ill-formed trees in symtable_assign(). Fixes SF bug 132510.
-rw-r--r-- | Python/compile.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c index 7b17404..2f98067 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4810,11 +4810,14 @@ symtable_assign(struct symtable *st, node *n, int flag) default: if (NCH(n) == 0) return; - if (NCH(n) != 1) { - DUMP(n); - Py_FatalError("too many children in default case\n"); + if (NCH(n) == 1) { + n = CHILD(n, 0); + goto loop; } - n = CHILD(n, 0); - goto loop; + /* Should only occur for errors like x + 1 = 1, + which will be caught in the next pass. */ + for (i = 0; i < NCH(n); ++i) + if (TYPE(CHILD(n, i)) >= single_input) + symtable_assign(st, CHILD(n, i), flag); } } |