Fix compile error when debugging (#59616)

Summary:
Signed-off-by: caozhong <zhong.z.cao@intel.com>

Triggered this probably because my full debug version python. ezyang

Pull Request resolved: https://github.com/pytorch/pytorch/pull/59616

Reviewed By: jbschlosser

Differential Revision: D28958685

Pulled By: albanD

fbshipit-source-id: fdab622c4d1be93eb27e9006dcf3db7c5b44a04b
This commit is contained in:
caozhong
2021-06-09 06:32:48 -07:00
committed by Facebook GitHub Bot
parent f1786b293d
commit 2693b0bef3

View File

@ -263,7 +263,7 @@ static bool THPVariable_tryResurrect(THPVariable* self) {
// NB: this will overreport _Py_RefTotal but based on inspection of object.c
// there is no way to avoid this
#ifdef Py_TRACE_REFS
_Py_AddToAllObjects(op, 1);
_Py_AddToAllObjects(reinterpret_cast<PyObject *>(self), 1);
#endif
Py_INCREF(self);