diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index a68d839a7f7de0b..dbdbae079f44207 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -2540,6 +2540,16 @@ msvcrt_CrtSetReportFile(PyObject* self, PyObject *args) #endif +static PyObject* +stack_pointer(PyObject *self, PyObject *args) +{ + int v = 5; + Py_uintptr_t sp = (Py_uintptr_t)&v; + + return PyLong_FromUnsignedLongLong(sp); +} + + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"set_errno", set_errno, METH_VARARGS}, @@ -2656,6 +2666,7 @@ static PyMethodDef TestMethods[] = { {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_VARARGS}, {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_VARARGS}, #endif + {"stack_pointer", stack_pointer, METH_NOARGS}, {NULL, NULL} /* sentinel */ };