barbieri pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e3e0a6bd65e7168bf2ca53b305708c52d9951b1b

commit e3e0a6bd65e7168bf2ca53b305708c52d9951b1b
Author: Gustavo Sverzut Barbieri <[email protected]>
Date:   Tue Aug 16 21:41:26 2016 -0300

    eolian: gracefully handle incorrect case of inherit.
    
    If you use "EFl" instead of "Efl", it will find the proper file, but
    won't find the type... crashing.
    
    Handle that case and hint the user about it.
---
 src/lib/eolian/eo_parser.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index ead4183..d81b8d7 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -1924,7 +1924,14 @@ _inherit_dep(Eo_Lexer *ls, Eina_Strbuf *buf, Eina_Bool 
check_inherit,
      }
    _parse_dep(ls, fname, iname);
    const Eolian_Class *dep = eolian_class_get_by_name(iname);
-   assert(dep != NULL);
+   if (!dep)
+     {
+        char ebuf[PATH_MAX];
+        eo_lexer_context_restore(ls);
+        snprintf(ebuf, sizeof(ebuf), "unknown inherit '%s'. Incorrect case?", 
iname);
+        eo_lexer_syntax_error(ls, ebuf);
+        return;
+     }
    if (check_inherit) switch (type)
      {
       case EOLIAN_CLASS_REGULAR:

-- 


Reply via email to