diff options
author | Oleg Iarygin <oleg@arhadthedev.net> | 2022-07-04 13:09:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 13:09:34 (GMT) |
commit | 21f6b4d7838fa16341faf735456b05f8ede9e4f9 (patch) | |
tree | 5e1eca3250b7ce4cc3b40339afa2ac97348160e4 /PC/clinic/msvcrtmodule.c.h | |
parent | a391b74dbed085e4c8b922c79dcf7a9d9e72d3df (diff) | |
download | cpython-21f6b4d7838fa16341faf735456b05f8ede9e4f9.zip cpython-21f6b4d7838fa16341faf735456b05f8ede9e4f9.tar.gz cpython-21f6b4d7838fa16341faf735456b05f8ede9e4f9.tar.bz2 |
gh-94512: Fix forced arg format in AC-processed msvcrtmodule (GH-94514)
Diffstat (limited to 'PC/clinic/msvcrtmodule.c.h')
-rw-r--r-- | PC/clinic/msvcrtmodule.c.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index ea95897..e60fbd0 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -141,8 +141,15 @@ msvcrt_open_osfhandle(PyObject *module, PyObject *const *args, Py_ssize_t nargs) int flags; long _return_value; - if (!_PyArg_ParseStack(args, nargs, ""_Py_PARSE_UINTPTR"i:open_osfhandle", - &handle, &flags)) { + if (!_PyArg_CheckPositional("open_osfhandle", nargs, 2, 2)) { + goto exit; + } + handle = PyLong_AsVoidPtr(args[0]); + if (!handle && PyErr_Occurred()) { + goto exit; + } + flags = _PyLong_AsInt(args[1]); + if (flags == -1 && PyErr_Occurred()) { goto exit; } _return_value = msvcrt_open_osfhandle_impl(module, handle, flags); @@ -488,8 +495,15 @@ msvcrt_CrtSetReportFile(PyObject *module, PyObject *const *args, Py_ssize_t narg void *file; void *_return_value; - if (!_PyArg_ParseStack(args, nargs, "i"_Py_PARSE_UINTPTR":CrtSetReportFile", - &type, &file)) { + if (!_PyArg_CheckPositional("CrtSetReportFile", nargs, 2, 2)) { + goto exit; + } + type = _PyLong_AsInt(args[0]); + if (type == -1 && PyErr_Occurred()) { + goto exit; + } + file = PyLong_AsVoidPtr(args[1]); + if (!file && PyErr_Occurred()) { goto exit; } _return_value = msvcrt_CrtSetReportFile_impl(module, type, file); @@ -647,4 +661,4 @@ exit: #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=b543933cad520f2b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9d89e9414484d28c input=a9049054013a1b77]*/ |