summaryrefslogtreecommitdiffstats
path: root/Python/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/frame.c')
-rw-r--r--Python/frame.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/frame.c b/Python/frame.c
index 6a287d4..b562709 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -84,6 +84,7 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
assert(frame->owner != FRAME_OWNED_BY_FRAME_OBJECT);
assert(frame->owner != FRAME_CLEARED);
Py_ssize_t size = ((char*)&frame->localsplus[frame->stacktop]) - (char *)frame;
+ Py_INCREF(frame->f_code);
memcpy((_PyInterpreterFrame *)f->_f_frame_data, frame, size);
frame = (_PyInterpreterFrame *)f->_f_frame_data;
f->f_frame = frame;
@@ -118,7 +119,7 @@ take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
}
void
-_PyFrame_Clear(_PyInterpreterFrame *frame)
+_PyFrame_ClearExceptCode(_PyInterpreterFrame *frame)
{
/* It is the responsibility of the owning generator/coroutine
* to have cleared the enclosing generator, if any. */
@@ -144,7 +145,6 @@ _PyFrame_Clear(_PyInterpreterFrame *frame)
Py_XDECREF(frame->frame_obj);
Py_XDECREF(frame->f_locals);
Py_DECREF(frame->f_funcobj);
- Py_DECREF(frame->f_code);
}
int