Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Sep 25, 2024
1 parent 2479da8 commit c5825fb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
13 changes: 5 additions & 8 deletions Include/internal/pycore_cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,12 @@ _PyCell_GetStackRef(PyCellObject *cell, _PyStackRef *value_addr)
{
PyObject *value;
#ifdef Py_GIL_DISABLED
for(;;) {
value = _Py_atomic_load_ptr(&cell->ob_ref);
if (value != NULL) {
if (_Py_TryIncrefCompare(&cell->ob_ref, value)) {
*value_addr = _PyStackRef_FromPyObjectSteal(value);
return;
}
value = _Py_atomic_load_ptr(&cell->ob_ref);
if (value != NULL) {
if (_Py_TryIncrefCompare(&cell->ob_ref, value)) {
*value_addr = _PyStackRef_FromPyObjectSteal(value);
return;
}
break;
}
#endif
value = PyCell_GetRef(cell);
Expand Down
6 changes: 3 additions & 3 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,10 +1647,10 @@ dummy_func(
value = PyStackRef_FromPyObjectSteal(value_o);
}

inst(LOAD_DEREF, ( -- value[1])) {
inst(LOAD_DEREF, ( -- value)) {
PyCellObject *cell = (PyCellObject *)PyStackRef_AsPyObjectBorrow(GETLOCAL(oparg));
_PyCell_GetStackRef(cell, value);
if (PyStackRef_IsNull(*value)) {
_PyCell_GetStackRef(cell, &value);
if (PyStackRef_IsNull(value)) {
_PyEval_FormatExcUnbound(tstate, _PyFrame_GetCode(frame), oparg);
ERROR_IF(true, error);
}
Expand Down
8 changes: 4 additions & 4 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5825fb

Please sign in to comment.