Skip to content

Commit 14b89e5

Browse files
Address review
1 parent a2754b7 commit 14b89e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Include/internal/pycore_stackref.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ _PyStackRef_Borrow(_PyStackRef ref, const char *filename, int linenumber)
289289
static inline _PyStackRef
290290
_PyStackRef_FromPyObjectStealMortal(PyObject *obj, const char *filename, int linenumber)
291291
{
292+
assert(obj != NULL);
292293
assert(!_Py_IsImmortal(obj));
293294
return _Py_stackref_create(obj, 0, filename, linenumber);
294295
}
@@ -324,7 +325,7 @@ _PyStackRef_FromPyObjectNewMortal(PyObject *obj, const char *filename, int linen
324325
{
325326
assert(obj != NULL);
326327
assert(!_Py_IsStaticImmortal(obj));
327-
Py_XINCREF(obj);
328+
Py_INCREF(obj);
328329
return _Py_stackref_create(obj, 0, filename, linenumber);
329330
}
330331
#define PyStackRef_FromPyObjectNewMortal(obj) _PyStackRef_FromPyObjectNewMortal(_PyObject_CAST(obj), __FILE__, __LINE__)

0 commit comments

Comments
 (0)