diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-09-30 09:43:41 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-10-01 08:21:12 +0200 |
commit | 670282e2b88806cff8018e6105647bf08a6dc52d (patch) | |
tree | b3a862abe81dfcc71bf18ff7e0891b2fed4418d9 | |
parent | 3f31779af61c064c5bcbebaa588c7fd18a591b0d (diff) |
patch_tp_new_wrapper(): Add an assert for the "__new__" entry
The entry should be present, unless there is some mistake in the
string creation functions.
Task-number: PYSIDE-1087
Change-Id: Idbcf651be5daf2048f1a6845dd93bdcd9700e63b
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/shiboken2/libshiboken/basewrapper.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp index 15993aff0..000035627 100644 --- a/sources/shiboken2/libshiboken/basewrapper.cpp +++ b/sources/shiboken2/libshiboken/basewrapper.cpp @@ -164,6 +164,7 @@ patch_tp_new_wrapper(PyTypeObject *type) auto newMethod = Shiboken::PyMagicName::new_(); if (old_tp_new_wrapper == nullptr) { PyObject *func = PyDict_GetItem(PyType_Type.tp_dict, newMethod); + assert(func); PyCFunctionObject *pycf_ob = reinterpret_cast<PyCFunctionObject *>(func); old_tp_new_wrapper = reinterpret_cast<ternaryfunc>(pycf_ob->m_ml->ml_meth); } |