diff options
author | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-06-02 23:07:46 +0300 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-06-03 08:58:05 +0300 |
commit | 7a83c9c659cb9c41601360d608e783e69ffef3a2 (patch) | |
tree | d683cc0c3acb6ba16bb206c33286808226edbce2 /src/bin/eolian/eo1_generator.c | |
parent | f3ce7031e20b1cc9d6598f2f29c70e4a0ad91a8f (diff) |
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
Diffstat (limited to 'src/bin/eolian/eo1_generator.c')
-rw-r--r-- | src/bin/eolian/eo1_generator.c | 22 |
1 files changed, 12 insertions, 10 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) | |||
624 | Eolian_Implement impl_desc; | 624 | Eolian_Implement impl_desc; |
625 | EINA_LIST_FOREACH(eolian_class_implements_list_get(class), itr, impl_desc) | 625 | EINA_LIST_FOREACH(eolian_class_implements_list_get(class), itr, impl_desc) |
626 | { | 626 | { |
627 | Eolian_Class impl_class; | ||
628 | Eolian_Function_Type ftype; | ||
629 | _eolian_class_vars impl_env; | 627 | _eolian_class_vars impl_env; |
630 | Eolian_Function fnid; | 628 | char implname[0xFF]; |
629 | Eolian_Class impl_class = NULL; | ||
630 | Eolian_Function_Type ftype; | ||
631 | Eolian_Function fnid = NULL; | ||
631 | const char *funcname; | 632 | const char *funcname; |
633 | char *tp = implname; | ||
632 | 634 | ||
633 | eolian_implement_information_get(impl_desc, &impl_class, &fnid, &ftype); | 635 | if (eolian_implement_information_get(impl_desc, &impl_class, &fnid, &ftype)) |
634 | _class_env_create(impl_class, NULL, &impl_env); | 636 | { |
635 | funcname = eolian_function_name_get(fnid); | 637 | _class_env_create(impl_class, NULL, &impl_env); |
638 | funcname = eolian_function_name_get(fnid); | ||
636 | 639 | ||
637 | char implname[0xFF]; | 640 | sprintf(implname, "%s_%s", class_env.full_classname, impl_env.full_classname); |
638 | char *tp = implname; | 641 | eina_str_tolower(&tp); |
639 | sprintf(implname, "%s_%s", class_env.full_classname, impl_env.full_classname); | 642 | } |
640 | eina_str_tolower(&tp); | ||
641 | 643 | ||
642 | if (!fnid) | 644 | if (!fnid) |
643 | { | 645 | { |