We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2abc7e commit b92c34aCopy full SHA for b92c34a
Include/internal/pycore_frame.h
@@ -113,8 +113,10 @@ _PyFrame_NumSlotsForCodeObject(PyCodeObject *code)
113
static inline void _PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *dest)
114
{
115
assert(src->stacktop >= _PyFrame_GetCode(src)->co_nlocalsplus);
116
- Py_ssize_t size = ((char*)&src->localsplus[src->stacktop]) - (char *)src;
117
- memcpy(dest, src, size);
+ *dest = *src;
+ for (int i = 1; i < src->stacktop; i++) {
118
+ dest->localsplus[i] = src->localsplus[i];
119
+ }
120
// Don't leave a dangling pointer to the old frame when creating generators
121
// and coroutines:
122
dest->previous = NULL;
0 commit comments