Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 23786:e0fbf9c4d46c 2.2
Backport:
SF bug 567538: Generator can crash the interpreter (Finn Bock).
This was a simple typo. Strange that the compiler didn't catch it!
Instead of WHY_CONTINUE, two tests used CONTINUE_LOOP, which isn't a
why_code at all, but an opcode; but even though 'why' is declared as
an enum, comparing it to an int is apparently not even worth a
warning -- not in gcc, and not in VC++. :-(
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 12 Jun 2002 03:48:46 +0000 |
| parents | a6bb3cc919b9 |
| children | 7ca46e08200d |
line wrap: on
line diff
--- a/Python/ceval.c Tue Jun 11 02:57:32 2002 +0000 +++ b/Python/ceval.c Wed Jun 12 03:48:46 2002 +0000 @@ -1497,7 +1497,7 @@ why = (enum why_code) PyInt_AsLong(v); if (why == WHY_RETURN || why == WHY_YIELD || - why == CONTINUE_LOOP) + why == WHY_CONTINUE) retval = POP(); } else if (PyString_Check(v) || PyClass_Check(v)) { @@ -2293,7 +2293,7 @@ } else { if (why == WHY_RETURN || - why == CONTINUE_LOOP) + why == WHY_CONTINUE) PUSH(retval); v = PyInt_FromLong((long)why); PUSH(v);
