From 7a83c9c659cb9c41601360d608e783e69ffef3a2 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Mon, 2 Jun 2014 23:07:46 +0300 Subject: [PATCH] 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 --- src/bin/eolian/eo1_generator.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c index c8f5829b35..67d5f634c6 100644 --- a/src/bin/eolian/eo1_generator.c +++ b/src/bin/eolian/eo1_generator.c @@ -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) {