Skip to content

Commit

Permalink
Use stackrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Oct 4, 2024
1 parent efc032a commit f83c7c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Python/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ _PyOptimizer_Optimize(
// this is true, since a deopt won't infinitely re-enter the executor:
chain_depth %= MAX_CHAIN_DEPTH;
bool progress_needed = chain_depth == 0;
if (!PyCode_Check(frame->f_executable) ||
!PyFunction_Check(frame->f_funcobj))
if (!PyCode_Check(PyStackRef_AsPyObjectBorrow(frame->f_executable)) ||
!PyFunction_Check(PyStackRef_AsPyObjectBorrow(frame->f_funcobj)))
{
return 0;
}
Expand Down

0 comments on commit f83c7c1

Please sign in to comment.