Eolian: Fix bad behavior when the .eo is incorrect

In this case, the section 'implements' contains bad information about the
function to override. If the first (at least) function is correct, it
will never fail but use the last correct information retrieved from the
database.
The patch fixes it by checking the result of the database function
eolian_implement_information_get.

@fix
This commit is contained in:
Daniel Zaoui 2014-06-02 23:07:46 +03:00
parent f3ce7031e2
commit 7a83c9c659
1 changed files with 13 additions and 11 deletions

View File

@ -624,20 +624,22 @@ eo_source_end_generate(const Eolian_Class class, Eina_Strbuf *buf)
Eolian_Implement impl_desc;
EINA_LIST_FOREACH(eolian_class_implements_list_get(class), itr, impl_desc)
{
Eolian_Class impl_class;
Eolian_Function_Type ftype;
_eolian_class_vars impl_env;
Eolian_Function fnid;
const char *funcname;
eolian_implement_information_get(impl_desc, &impl_class, &fnid, &ftype);
_class_env_create(impl_class, NULL, &impl_env);
funcname = eolian_function_name_get(fnid);
char implname[0xFF];
Eolian_Class impl_class = NULL;
Eolian_Function_Type ftype;
Eolian_Function fnid = NULL;
const char *funcname;
char *tp = implname;
sprintf(implname, "%s_%s", class_env.full_classname, impl_env.full_classname);
eina_str_tolower(&tp);
if (eolian_implement_information_get(impl_desc, &impl_class, &fnid, &ftype))
{
_class_env_create(impl_class, NULL, &impl_env);
funcname = eolian_function_name_get(fnid);
sprintf(implname, "%s_%s", class_env.full_classname, impl_env.full_classname);
eina_str_tolower(&tp);
}
if (!fnid)
{