summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 6a51a94..bd1608e 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -645,9 +645,12 @@ add_load_fast_null_checks(PyCodeObject *co)
}
i += _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
}
- if (changed) {
+ if (changed && co->_co_cached != NULL) {
// invalidate cached co_code object
- Py_CLEAR(co->_co_code);
+ Py_CLEAR(co->_co_cached->_co_code);
+ Py_CLEAR(co->_co_cached->_co_cellvars);
+ Py_CLEAR(co->_co_cached->_co_freevars);
+ Py_CLEAR(co->_co_cached->_co_varnames);
}
}