Eo: don't allow object override to introduce previously undefined functions.

This commit is contained in:
Tom Hacohen 2016-09-09 10:53:45 +01:00
parent 8b159aab68
commit 5ad71f1486
2 changed files with 7 additions and 1 deletions

View File

@ -648,6 +648,12 @@ _eo_class_funcs_set(Eo_Vtable *vtable, const Efl_Object_Ops *ops, const _Efl_Cla
if (op == EFL_NOOP)
{
if (override_only)
{
ERR("Class '%s': Tried overriding a previously undefined function.", klass->desc->name);
return EINA_FALSE;
}
op = op_id;
eina_spinlock_take(&_ops_storage_lock);
#ifndef _WIN32

View File

@ -104,7 +104,7 @@ START_TEST(efl_object_override_tests)
overrides3,
EFL_OBJECT_OP_FUNC(simple2_class_beef_get, _simple_obj_override_a_double_set));
fail_if(!efl_object_override(obj, NULL));
fail_if(!efl_object_override(obj, &overrides3));
fail_if(efl_object_override(obj, &overrides3));
/* Test override reset */
fail_if(!efl_object_override(obj, NULL));