eolian: fix segfault in validator + fill in line info properly
authorDaniel Kolesa <d.kolesa@samsung.com>
Fri, 22 Aug 2014 12:28:29 +0000 (13:28 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Fri, 22 Aug 2014 12:28:29 +0000 (13:28 +0100)
src/lib/eolian/database_validate.c
src/lib/eolian/eo_parser.c

index 620f9b1153fd2ae493b92d832dfc2104922bc1d1..eb2e5b7168bce82e68213bb179f531ed70ceeb74 100644 (file)
@@ -87,7 +87,7 @@ _validate_type(const Eolian_Type *tp)
         {
            Eina_List *l;
            Eolian_Type *tpp;
-           if (!_validate_type(tp->ret_type))
+           if (tp->ret_type && !_validate_type(tp->ret_type))
              return EINA_FALSE;
            EINA_LIST_FOREACH(tp->arguments, l, tpp)
              if (!_validate_type(tpp))
index 2a6de85e0c9fd015b9962de5168e3c3c65bb3c2b..d08d7eb11c3e8e92315e8f1cc962577b2c4b704b 100644 (file)
@@ -889,6 +889,9 @@ parse_type_named_void(Eo_Lexer *ls, Eina_Bool allow_named)
            def = push_type(ls);
            def->type = is_enum ? EOLIAN_TYPE_REGULAR_ENUM
                                : EOLIAN_TYPE_REGULAR_STRUCT;
+           def->base.file = eina_stringshare_ref(ls->filename);
+           def->base.line = line;
+           def->base.column = col;
            pop_str(ls);
            _fill_type_name(def, sname);
            goto parse_ptr;