Skip to content

Commit 1fb15e3

Browse files
committed
Mark Py_DECREF and Py_XDECREF as escaping
1 parent 4533036 commit 1fb15e3

File tree

5 files changed

+119
-61
lines changed

5 files changed

+119
-61
lines changed

Python/bytecodes.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,10 +1004,10 @@ dummy_func(
10041004
PyList_SET_ITEM(list, index, PyStackRef_AsPyObjectSteal(value));
10051005
assert(old_value != NULL);
10061006
UNLOCK_OBJECT(list); // unlock before decrefs!
1007-
Py_DECREF(old_value);
10081007
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
10091008
DEAD(sub_st);
10101009
PyStackRef_CLOSE(list_st);
1010+
Py_DECREF(old_value);
10111011
}
10121012

10131013
inst(STORE_SUBSCR_DICT, (unused/1, value, dict_st, sub -- )) {
@@ -2412,8 +2412,8 @@ dummy_func(
24122412
_PyDictValues_AddToInsertionOrder(values, index);
24132413
}
24142414
UNLOCK_OBJECT(owner_o);
2415-
Py_XDECREF(old_value);
24162415
PyStackRef_CLOSE(owner);
2416+
Py_XDECREF(old_value);
24172417
}
24182418

24192419
macro(STORE_ATTR_INSTANCE_VALUE) =
@@ -2457,9 +2457,9 @@ dummy_func(
24572457

24582458
// old_value should be DECREFed after GC track checking is done, if not, it could raise a segmentation fault,
24592459
// when dict only holds the strong reference to value in ep->me_value.
2460-
Py_XDECREF(old_value);
24612460
STAT_INC(STORE_ATTR, hit);
24622461
PyStackRef_CLOSE(owner);
2462+
Py_XDECREF(old_value);
24632463
}
24642464

24652465
macro(STORE_ATTR_WITH_HINT) =
@@ -2476,8 +2476,8 @@ dummy_func(
24762476
PyObject *old_value = *(PyObject **)addr;
24772477
FT_ATOMIC_STORE_PTR_RELEASE(*(PyObject **)addr, PyStackRef_AsPyObjectSteal(value));
24782478
UNLOCK_OBJECT(owner_o);
2479-
Py_XDECREF(old_value);
24802479
PyStackRef_CLOSE(owner);
2480+
Py_XDECREF(old_value);
24812481
}
24822482

24832483
macro(STORE_ATTR_SLOT) =

Python/executor_cases.c.h

Lines changed: 29 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 40 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)