mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.1917: undefined behaviour with python function pointer
Problem: undefined behaviour with python function pointer Solution: correctly cast function pointers from void Fix more undefined behaviors in if_python Fix remaining UBSAN errors from Clang 17 in if_python in casting function pointers. Also fix a mistake where `PyMem_Free()` should be returning void, by the dynamic build is mistakenly casting it as a function that returns an int. closes: #13128 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
This commit is contained in:
committed by
Christian Brabandt
parent
aa64ba1587
commit
d606fccf6f
@@ -317,7 +317,7 @@ struct PyMethodDef { Py_ssize_t a; };
|
||||
*/
|
||||
static int(*dll_PyArg_Parse)(PyObject *, char *, ...);
|
||||
static int(*dll_PyArg_ParseTuple)(PyObject *, char *, ...);
|
||||
static int(*dll_PyMem_Free)(void *);
|
||||
static void(*dll_PyMem_Free)(void *);
|
||||
static void* (*dll_PyMem_Malloc)(size_t);
|
||||
static int(*dll_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
|
||||
static int(*dll_PyErr_BadArgument)(void);
|
||||
|
Reference in New Issue
Block a user