diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 13:48:15 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-11 13:48:15 +0300 |
commit | 2fdfdf47618ed421642a743b67d2616c7dae138e (patch) | |
tree | d93393c23e69dce5fe997d266442c23e2dd9eec4 /Objects/genobject.c | |
parent | ef8046927db59063e40dc9bfa5afe4a6cb3ef8cd (diff) | |
download | cpython-2fdfdf47618ed421642a743b67d2616c7dae138e.tar.gz |
Issue #27129: Replaced wordcode related magic constants with macros.
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r-- | Objects/genobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index bc5309a82a..7a1e9fd6ab 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -390,7 +390,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 + 2] != YIELD_FROM) + if (code[f->f_lasti + sizeof(_Py_CODEUNIT)] != YIELD_FROM) return NULL; yf = f->f_stacktop[-1]; Py_INCREF(yf); @@ -498,7 +498,7 @@ _gen_throw(PyGenObject *gen, int close_on_genexit, assert(ret == yf); Py_DECREF(ret); /* Termination repetition of YIELD_FROM */ - gen->gi_frame->f_lasti += 2; + gen->gi_frame->f_lasti += sizeof(_Py_CODEUNIT); if (_PyGen_FetchStopIterationValue(&val) == 0) { ret = gen_send_ex(gen, val, 0, 0); Py_DECREF(val); |