From cc043200068f4299cc5c6f126327bc1993486135 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 17 Oct 2018 09:58:06 +0200 Subject: Fix crash when using a MSVC debug build The pointers of probe_tp_name and check->tp_name are different when using the MSVC debug runtime. Use strcmp() instead. Fixes: PYSIDE-835 Change-Id: I8b6735a9a407bf3325986edd61a7911964802a24 Reviewed-by: Cristian Maureira-Fredes Reviewed-by: Alexandru Croitor --- sources/shiboken2/libshiboken/pep384impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/shiboken2/libshiboken/pep384impl.cpp b/sources/shiboken2/libshiboken/pep384impl.cpp index 4481f1cdd..0baf6ed42 100644 --- a/sources/shiboken2/libshiboken/pep384impl.cpp +++ b/sources/shiboken2/libshiboken/pep384impl.cpp @@ -130,7 +130,7 @@ check_PyTypeObject_valid(void) long probe_tp_dictoffset = PyLong_AsLong(d); PyObject *probe_tp_mro = PyObject_GetAttrString(obtype, "__mro__"); if (false - || (probe_tp_name - check->tp_name) != 0 // to avoid warning + || strcmp(probe_tp_name, check->tp_name) != 0 || probe_tp_basicsize != check->tp_basicsize || probe_tp_call != check->tp_call || probe_tp_str != check->tp_str -- cgit v1.2.3