forked from enlightenment/efl
eo: check for empty vtable and failed extensions.
if for some reason we fail to validate a class, then we should skip that extension. This may result in an empty vtable, then check for that and avoid a crash. This is very unlike to happen in practice, but I've forced some validation errors and could get to that.
This commit is contained in:
parent
dfe3a4ad40
commit
fc48161910
|
@ -1249,6 +1249,8 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
|
||||||
while (extn_id)
|
while (extn_id)
|
||||||
{
|
{
|
||||||
extn = _eo_class_pointer_get((Efl_Class *)extn_id, __FUNCTION__, __FILE__, __LINE__);
|
extn = _eo_class_pointer_get((Efl_Class *)extn_id, __FUNCTION__, __FILE__, __LINE__);
|
||||||
|
if (!extn) /* did not validate */
|
||||||
|
continue;
|
||||||
switch (extn->desc->type)
|
switch (extn->desc->type)
|
||||||
{
|
{
|
||||||
case EFL_CLASS_TYPE_REGULAR_NO_INSTANT:
|
case EFL_CLASS_TYPE_REGULAR_NO_INSTANT:
|
||||||
|
@ -1412,6 +1414,7 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark which classes we implement */
|
/* Mark which classes we implement */
|
||||||
|
if (klass->vtable.size)
|
||||||
{
|
{
|
||||||
const _Efl_Class **extn_itr;
|
const _Efl_Class **extn_itr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue