Kaydet (Commit) 17820c4f authored tarafından Jeremy Hylton's avatar Jeremy Hylton

Tolerate ill-formed trees in symtable_assign(). Fixes SF bug 132510.

üst b6a44253
...@@ -4810,11 +4810,14 @@ symtable_assign(struct symtable *st, node *n, int flag) ...@@ -4810,11 +4810,14 @@ symtable_assign(struct symtable *st, node *n, int flag)
default: default:
if (NCH(n) == 0) if (NCH(n) == 0)
return; return;
if (NCH(n) != 1) { if (NCH(n) == 1) {
DUMP(n); n = CHILD(n, 0);
Py_FatalError("too many children in default case\n"); goto loop;
} }
n = CHILD(n, 0); /* Should only occur for errors like x + 1 = 1,
goto loop; 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);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment