mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-100987: Don't cache references to the names and consts array in _PyEval_EvalFrameDefault
. (#102640)
* Rename local variables, names and consts, from the interpeter loop. Will allow non-code objects in frames for better introspection of C builtins and extensions. * Remove unused dummy variables.
This commit is contained in:
parent
634cb61909
commit
2d370da570
3 changed files with 44 additions and 53 deletions
|
@ -773,18 +773,11 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
|
|||
/* Local "register" variables.
|
||||
* These are cached values from the frame and code object. */
|
||||
|
||||
PyObject *names;
|
||||
PyObject *consts;
|
||||
_Py_CODEUNIT *next_instr;
|
||||
PyObject **stack_pointer;
|
||||
|
||||
/* Sets the above local variables from the frame */
|
||||
#define SET_LOCALS_FROM_FRAME() \
|
||||
{ \
|
||||
PyCodeObject *co = frame->f_code; \
|
||||
names = co->co_names; \
|
||||
consts = co->co_consts; \
|
||||
} \
|
||||
assert(_PyInterpreterFrame_LASTI(frame) >= -1); \
|
||||
/* Jump back to the last instruction executed... */ \
|
||||
next_instr = frame->prev_instr + 1; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue