Issue #28665: Use macro form of PyCell_GET/SET
This commit is contained in:
parent
e42df24d72
commit
c32f9db846
|
@ -2405,8 +2405,10 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
|
||||||
|
|
||||||
TARGET(DELETE_DEREF) {
|
TARGET(DELETE_DEREF) {
|
||||||
PyObject *cell = freevars[oparg];
|
PyObject *cell = freevars[oparg];
|
||||||
if (PyCell_GET(cell) != NULL) {
|
PyObject *oldobj = PyCell_GET(cell);
|
||||||
PyCell_Set(cell, NULL);
|
if (oldobj != NULL) {
|
||||||
|
PyCell_SET(cell, NULL);
|
||||||
|
Py_DECREF(oldobj);
|
||||||
DISPATCH();
|
DISPATCH();
|
||||||
}
|
}
|
||||||
format_exc_unbound(co, oparg);
|
format_exc_unbound(co, oparg);
|
||||||
|
@ -5351,8 +5353,10 @@ unicode_concatenate(PyObject *v, PyObject *w,
|
||||||
PyObject **freevars = (f->f_localsplus +
|
PyObject **freevars = (f->f_localsplus +
|
||||||
f->f_code->co_nlocals);
|
f->f_code->co_nlocals);
|
||||||
PyObject *c = freevars[oparg];
|
PyObject *c = freevars[oparg];
|
||||||
if (PyCell_GET(c) == v)
|
if (PyCell_GET(c) == v) {
|
||||||
PyCell_Set(c, NULL);
|
PyCell_SET(c, NULL);
|
||||||
|
Py_DECREF(v);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case STORE_NAME:
|
case STORE_NAME:
|
||||||
|
|
Loading…
Reference in New Issue