summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-02-19 10:13:47 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-02-26 16:25:01 +0100
commit2d520158233b35c408677e61da79e8beda17c41c (patch)
tree1f8aed399d2966a23e4fe26b442a375d897dabdb /src
parent13502a159c2a8e1c1bd18f63235815d43ce87273 (diff)
eo: first check class desc in eo_class_new
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/eo.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index b2cec78794..de79d77af2 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -763,6 +763,14 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
763 size_t extn_sz, mro_sz, mixins_sz; 763 size_t extn_sz, mro_sz, mixins_sz;
764 Eina_List *extn_list, *mro, *mixins; 764 Eina_List *extn_list, *mro, *mixins;
765 765
766 EINA_SAFETY_ON_NULL_RETURN_VAL(desc, NULL);
767 EINA_SAFETY_ON_NULL_RETURN_VAL(desc->name, NULL);
768
769 DBG("Started building class '%s'", desc->name);
770
771 if (!_eo_class_check_op_descs(desc))
772 return NULL;
773
766 _Eo_Class *parent = _eo_class_pointer_get(parent_id); 774 _Eo_Class *parent = _eo_class_pointer_get(parent_id);
767#ifndef HAVE_EO_ID 775#ifndef HAVE_EO_ID
768 if (parent && !EINA_MAGIC_CHECK((Eo_Base *) parent, EO_CLASS_EINA_MAGIC)) 776 if (parent && !EINA_MAGIC_CHECK((Eo_Base *) parent, EO_CLASS_EINA_MAGIC))
@@ -772,12 +780,6 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
772 } 780 }
773#endif 781#endif
774 782
775 EINA_SAFETY_ON_NULL_RETURN_VAL(desc, NULL);
776 EINA_SAFETY_ON_NULL_RETURN_VAL(desc->name, NULL);
777
778 if (!_eo_class_check_op_descs(desc))
779 return NULL;
780
781 /* Check restrictions on Interface types. */ 783 /* Check restrictions on Interface types. */
782 if (desc->type == EO_CLASS_TYPE_INTERFACE) 784 if (desc->type == EO_CLASS_TYPE_INTERFACE)
783 { 785 {
@@ -1027,6 +1029,8 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
1027 1029
1028 _eo_class_constructor(klass); 1030 _eo_class_constructor(klass);
1029 1031
1032 DBG("Finished building class '%s'", klass->desc->name);
1033
1030 return _eo_class_id_get(klass); 1034 return _eo_class_id_get(klass);
1031} 1035}
1032 1036