|
Lines 75-81
Link Here
|
| 75 |
Py_INCREF(g); /* exhausted -- can return 'g' itself */ |
75 |
Py_INCREF(g); /* exhausted -- can return 'g' itself */ |
| 76 |
return g; |
76 |
return g; |
| 77 |
} |
77 |
} |
| 78 |
if (f->f_nfreevars || f->f_ncells) { |
78 |
if (PySequence_Length(co->co_freevars) || PySequence_Length(co->co_cellvars)) { |
| 79 |
PyErr_SetString(PyExc_ValueError, "generator has cell or free vars"); |
79 |
PyErr_SetString(PyExc_ValueError, "generator has cell or free vars"); |
| 80 |
goto error; |
80 |
goto error; |
| 81 |
} |
81 |
} |
|
Lines 112-117
Link Here
|
| 112 |
PyFrameObject* f = NULL; |
112 |
PyFrameObject* f = NULL; |
| 113 |
PyFrameObject* f2 = NULL; |
113 |
PyFrameObject* f2 = NULL; |
| 114 |
PyCodeObject* co; |
114 |
PyCodeObject* co; |
|
|
115 |
PyCodeObject* code; |
| 116 |
PyCodeObject* code2; |
| 115 |
int i, res; |
117 |
int i, res; |
| 116 |
|
118 |
|
| 117 |
if (g != g2) |
119 |
if (g != g2) |
|
Lines 141-149
Link Here
|
| 141 |
Py_DECREF(x); |
143 |
Py_DECREF(x); |
| 142 |
goto error; |
144 |
goto error; |
| 143 |
} |
145 |
} |
| 144 |
f2 = (PyFrameObject*) x; |
|
|
| 145 |
|
146 |
|
| 146 |
if (f2->f_stacksize != f->f_stacksize) { |
147 |
code2 = (PyFrameObject*) x; |
|
|
148 |
if (code2->co_stacksize != code->co_stacksize) { |
| 147 |
PyErr_SetString(PyExc_TypeError, "stack size mismatch"); |
149 |
PyErr_SetString(PyExc_TypeError, "stack size mismatch"); |
| 148 |
goto error; |
150 |
goto error; |
| 149 |
} |
151 |
} |