aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-10-17 09:58:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-10-17 08:37:39 +0000
commitcc043200068f4299cc5c6f126327bc1993486135 (patch)
treee8897b1021757bff390cd265772c76be597415ce
parentb8201a3ad2e778ed58cb285369055dc4d0d450bd (diff)
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 <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.cpp2
1 files changed, 1 insertions, 1 deletions
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