diff options
| author | Guido van Rossum <guido@python.org> | 2002-06-12 03:48:46 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2002-06-12 03:48:46 +0000 |
| commit | 9d21cd7e1ac79097a87654ec2ed9c85d3b963e5e (patch) | |
| tree | 5ba99a394240463a4713354459fc3193494fffd3 /Python | |
| parent | 048127f1bd5619c8012c751415577956daf06100 (diff) | |
| download | cpython-git-9d21cd7e1ac79097a87654ec2ed9c85d3b963e5e.tar.gz | |
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++. :-(
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/ceval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 0fa5887781..914431afb1 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1497,7 +1497,7 @@ eval_frame(PyFrameObject *f) 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 @@ eval_frame(PyFrameObject *f) } else { if (why == WHY_RETURN || - why == CONTINUE_LOOP) + why == WHY_CONTINUE) PUSH(retval); v = PyInt_FromLong((long)why); PUSH(v); |
