summaryrefslogtreecommitdiff
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-24 09:15:14 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-24 09:15:14 +0300
commitb0f80b0312a99ca46323efc0e4d09b567553ed46 (patch)
tree323c414ce867d58fe60e127b4275e9931855a72f /Objects/genobject.c
parentc35f491a06bb55cba097ddcd9fcbc9452ec21fb1 (diff)
downloadcpython-git-b0f80b0312a99ca46323efc0e4d09b567553ed46.tar.gz
Issue #26647: Python interpreter now uses 16-bit wordcode instead of bytecode.
Patch by Demur Rumed.
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index c94a6ed53a..3ca9696a11 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -277,7 +277,7 @@ _PyGen_yf(PyGenObject *gen)
PyObject *bytecode = f->f_code->co_code;
unsigned char *code = (unsigned char *)PyBytes_AS_STRING(bytecode);
- if (code[f->f_lasti + 1] != YIELD_FROM)
+ if (code[f->f_lasti + 2] != YIELD_FROM)
return NULL;
yf = f->f_stacktop[-1];
Py_INCREF(yf);
@@ -376,7 +376,7 @@ gen_throw(PyGenObject *gen, PyObject *args)
assert(ret == yf);
Py_DECREF(ret);
/* Termination repetition of YIELD_FROM */
- gen->gi_frame->f_lasti++;
+ gen->gi_frame->f_lasti += 2;
if (_PyGen_FetchStopIterationValue(&val) == 0) {
ret = gen_send_ex(gen, val, 0, 0);
Py_DECREF(val);