Mercurial > vim
diff src/if_python3.c @ 33320:a9f0f0eae10e v9.0.1925
patch 9.0.1925: if_python: still undefined behaviour with function pointer
Commit: https://github.com/vim/vim/commit/02c51b1dd8e8b96e969ad7e408536fa208d90ac8
Author: Yee Cheng Chin <ychin.git@gmail.com>
Date: Thu Sep 21 16:40:12 2023 +0200
patch 9.0.1925: if_python: still undefined behaviour with function pointer
Problem: if_python: still undefined behaviour with function pointer
Solution: fix remaining problems
Fix remaining issues in the if_python code in casting incompatible
function pointers leading to Clang 17 giving runtime errors during
UBSAN.
closes: #13140
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 21 Sep 2023 16:45:07 +0200 |
parents | 924e9cb09df7 |
children | 3af53f2895dc |
line wrap: on
line diff
--- a/src/if_python3.c +++ b/src/if_python3.c @@ -1533,7 +1533,7 @@ OutputSetattro(PyObject *self, PyObject { GET_ATTR_STRING(name, nameobj); - return OutputSetattr((OutputObject *)(self), name, val); + return OutputSetattr(self, name, val); } /////////////////////////////////////////////////////// @@ -1611,7 +1611,7 @@ BufferSetattro(PyObject *self, PyObject { GET_ATTR_STRING(name, nameobj); - return BufferSetattr((BufferObject *)(self), name, val); + return BufferSetattr(self, name, val); } ////////////////// @@ -1837,7 +1837,7 @@ WindowSetattro(PyObject *self, PyObject { GET_ATTR_STRING(name, nameobj); - return WindowSetattr((WindowObject *)(self), name, val); + return WindowSetattr(self, name, val); } // Tab page list object - Definitions @@ -1911,7 +1911,7 @@ DictionaryGetattro(PyObject *self, PyObj DictionarySetattro(PyObject *self, PyObject *nameobj, PyObject *val) { GET_ATTR_STRING(name, nameobj); - return DictionarySetattr((DictionaryObject *)(self), name, val); + return DictionarySetattr(self, name, val); } // List object - Definitions @@ -1931,7 +1931,7 @@ ListGetattro(PyObject *self, PyObject *n ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val) { GET_ATTR_STRING(name, nameobj); - return ListSetattr((ListObject *)(self), name, val); + return ListSetattr(self, name, val); } // Function object - Definitions