src/corelib/kernel/qvariant.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
   464 
   464 
   465     /* The reason we cannot place this test in a case branch above for the types
   465     /* The reason we cannot place this test in a case branch above for the types
   466      * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
   466      * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include
   467      * user defined pointer types. */
   467      * user defined pointer types. */
   468     const char *const typeName = QMetaType::typeName(a->type);
   468     const char *const typeName = QMetaType::typeName(a->type);
   469     if (typeName[qstrlen(typeName) - 1] == '*')
   469     uint typeNameLen = qstrlen(typeName);
       
   470     if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*')
   470         return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
   471         return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr);
       
   472 
       
   473     if (a->is_null && b->is_null)
       
   474         return true;
   471 
   475 
   472     return a_ptr == b_ptr;
   476     return a_ptr == b_ptr;
   473 }
   477 }
   474 
   478 
   475 /*!
   479 /*!