Skip to content

Commit 5b9176b

Browse files
committed
Use _PyFrame_GetLocalsArray
1 parent 44d7dff commit 5b9176b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Python/gc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,10 @@ visit_decref(PyObject *op, void *parent)
537537
int
538538
_PyGC_VisitFrameStack(_PyInterpreterFrame *frame, visitproc visit, void *arg)
539539
{
540-
_PyStackRef *i = frame->localsplus;
540+
_PyStackRef *ref = _PyFrame_GetLocalsArray(frame);
541541
/* locals and stack */
542-
for (; i < frame->stackpointer; i++) {
543-
Py_VISIT(PyStackRef_AsPyObjectBorrow(*i));
542+
for (; ref < frame->stackpointer; ref++) {
543+
Py_VISIT(PyStackRef_AsPyObjectBorrow(*ref));
544544
}
545545
return 0;
546546
}

Python/gc_free_threading.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ visit_decref_unreachable(PyObject *op, void *data)
954954
int
955955
_PyGC_VisitFrameStack(_PyInterpreterFrame *frame, visitproc visit, void *arg)
956956
{
957-
_PyStackRef *ref = frame->localsplus;
957+
_PyStackRef *ref = _PyFrame_GetLocalsArray(frame);
958958
/* locals and stack */
959959
for (; ref < frame->stackpointer; ref++) {
960960
// This is a bit tricky! We want to ignore deferred references when

0 commit comments

Comments
 (0)