summaryrefslogtreecommitdiff
path: root/src/lib/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-09-26 15:58:17 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-09-26 16:19:12 +0200
commita95870286e45cc2c86736566b7d066feba8e56f8 (patch)
tree0fec4a59e49c347cc047b7bbdf2975230df42486 /src/lib/eolian
parent23bbf2bf3ae7c45d08e02ba23e0ced69c99f65c6 (diff)
eolian: stricter checks for const() validity
Diffstat (limited to 'src/lib/eolian')
-rw-r--r--src/lib/eolian/database_expr.c2
-rw-r--r--src/lib/eolian/database_type.c7
-rw-r--r--src/lib/eolian/database_validate.c70
-rw-r--r--src/lib/eolian/eo_parser.c36
-rw-r--r--src/lib/eolian/eolian_database.h2
5 files changed, 78 insertions, 39 deletions
diff --git a/src/lib/eolian/database_expr.c b/src/lib/eolian/database_expr.c
index 978f281a8f..38794a2f3c 100644
--- a/src/lib/eolian/database_expr.c
+++ b/src/lib/eolian/database_expr.c
@@ -613,7 +613,7 @@ database_expr_eval_type(const Eolian_Unit *unit, Eolian_Expression *expr,
613 return database_expr_eval(unit, expr, EOLIAN_MASK_NULL, cb, data); 613 return database_expr_eval(unit, expr, EOLIAN_MASK_NULL, cb, data);
614 case EOLIAN_TYPE_REGULAR: 614 case EOLIAN_TYPE_REGULAR:
615 { 615 {
616 if (database_type_is_ownable(unit, type, EINA_FALSE)) 616 if (database_type_is_ownable(unit, type, EINA_FALSE, NULL))
617 return database_expr_eval(unit, expr, EOLIAN_MASK_NULL, cb, data); 617 return database_expr_eval(unit, expr, EOLIAN_MASK_NULL, cb, data);
618 int kw = eo_lexer_keyword_str_to_id(type->base.name); 618 int kw = eo_lexer_keyword_str_to_id(type->base.name);
619 if (!kw || kw < KW_byte || kw >= KW_void) 619 if (!kw || kw < KW_byte || kw >= KW_void)
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index 52973fb453..53d531cc54 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -63,8 +63,9 @@ database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
63} 63}
64 64
65Eina_Bool 65Eina_Bool
66database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bool allow_void) 66database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bool allow_void, const Eolian_Type **otp)
67{ 67{
68 if (otp) *otp = tp;
68 if (tp->is_ptr) 69 if (tp->is_ptr)
69 return EINA_TRUE; 70 return EINA_TRUE;
70 if (tp->type == EOLIAN_TYPE_REGULAR) 71 if (tp->type == EOLIAN_TYPE_REGULAR)
@@ -79,7 +80,7 @@ database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bo
79 if (tpp->type == EOLIAN_TYPEDECL_FUNCTION_POINTER) 80 if (tpp->type == EOLIAN_TYPEDECL_FUNCTION_POINTER)
80 return EINA_TRUE; 81 return EINA_TRUE;
81 if (tpp->type == EOLIAN_TYPEDECL_ALIAS) 82 if (tpp->type == EOLIAN_TYPEDECL_ALIAS)
82 return database_type_is_ownable(unit, tpp->base_type, allow_void); 83 return database_type_is_ownable(unit, tpp->base_type, allow_void, otp);
83 return EINA_FALSE; 84 return EINA_FALSE;
84 } 85 }
85 return (ct[strlen(ct) - 1] == '*'); 86 return (ct[strlen(ct) - 1] == '*');
@@ -107,7 +108,7 @@ database_type_to_str(const Eolian_Type *tp,
107 || tp->type == EOLIAN_TYPE_CLASS 108 || tp->type == EOLIAN_TYPE_CLASS
108 || tp->type == EOLIAN_TYPE_VOID) 109 || tp->type == EOLIAN_TYPE_VOID)
109 && tp->is_const 110 && tp->is_const
110 && ((ctype != EOLIAN_C_TYPE_RETURN) || by_ref || database_type_is_ownable(NULL, tp, EINA_FALSE))) 111 && ((ctype != EOLIAN_C_TYPE_RETURN) || by_ref || database_type_is_ownable(NULL, tp, EINA_FALSE, NULL)))
111 { 112 {
112 eina_strbuf_append(buf, "const "); 113 eina_strbuf_append(buf, "const ");
113 } 114 }
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 87d51ac2e1..b80d418a3e 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -103,9 +103,11 @@ _validate_doc(Eolian_Documentation *doc)
103 return _validate(&doc->base); 103 return _validate(&doc->base);
104} 104}
105 105
106static Eina_Bool _validate_type(Validate_State *vals, Eolian_Type *tp); 106static Eina_Bool _validate_type(Validate_State *vals, Eolian_Type *tp,
107 Eina_Bool by_ref, Eina_Bool is_ret);
107static Eina_Bool _validate_type_by_ref(Validate_State *vals, Eolian_Type *tp, 108static Eina_Bool _validate_type_by_ref(Validate_State *vals, Eolian_Type *tp,
108 Eina_Bool by_ref, Eina_Bool move); 109 Eina_Bool by_ref, Eina_Bool move,
110 Eina_Bool is_ret);
109static Eina_Bool _validate_expr(Eolian_Expression *expr, 111static Eina_Bool _validate_expr(Eolian_Expression *expr,
110 const Eolian_Type *tp, 112 const Eolian_Type *tp,
111 Eolian_Expression_Mask msk, 113 Eolian_Expression_Mask msk,
@@ -124,7 +126,8 @@ static Eina_Bool
124_sf_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, 126_sf_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
125 const Eolian_Struct_Type_Field *sf, Cb_Ret *sc) 127 const Eolian_Struct_Type_Field *sf, Cb_Ret *sc)
126{ 128{
127 sc->succ = _validate_type_by_ref(sc->vals, sf->type, sf->by_ref, sf->move); 129 sc->succ = _validate_type_by_ref(sc->vals, sf->type, sf->by_ref,
130 sf->move, EINA_FALSE);
128 131
129 if (!sc->succ) 132 if (!sc->succ)
130 return EINA_FALSE; 133 return EINA_FALSE;
@@ -166,7 +169,7 @@ _validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp)
166 switch (tp->type) 169 switch (tp->type)
167 { 170 {
168 case EOLIAN_TYPEDECL_ALIAS: 171 case EOLIAN_TYPEDECL_ALIAS:
169 if (!_validate_type(vals, tp->base_type)) 172 if (!_validate_type(vals, tp->base_type, EINA_FALSE, EINA_FALSE))
170 return _reset_stable(vals, was_stable, EINA_FALSE); 173 return _reset_stable(vals, was_stable, EINA_FALSE);
171 if (tp->base_type->ownable) 174 if (tp->base_type->ownable)
172 tp->ownable = EINA_TRUE; 175 tp->ownable = EINA_TRUE;
@@ -215,7 +218,7 @@ static Eina_Bool
215_validate_by_ref(Eolian_Type *tp, Eina_Bool by_ref, Eina_Bool move) 218_validate_by_ref(Eolian_Type *tp, Eina_Bool by_ref, Eina_Bool move)
216{ 219{
217 Eina_Bool maybe_ownable = 220 Eina_Bool maybe_ownable =
218 database_type_is_ownable(tp->base.unit, tp, EINA_FALSE); 221 database_type_is_ownable(tp->base.unit, tp, EINA_FALSE, NULL);
219 222
220 /* only allow value types when @by_ref */ 223 /* only allow value types when @by_ref */
221 if (by_ref && maybe_ownable) 224 if (by_ref && maybe_ownable)
@@ -244,16 +247,17 @@ _validate_by_ref(Eolian_Type *tp, Eina_Bool by_ref, Eina_Bool move)
244 247
245static Eina_Bool 248static Eina_Bool
246_validate_type_by_ref(Validate_State *vals, Eolian_Type *tp, 249_validate_type_by_ref(Validate_State *vals, Eolian_Type *tp,
247 Eina_Bool by_ref, Eina_Bool move) 250 Eina_Bool by_ref, Eina_Bool move, Eina_Bool is_ret)
248{ 251{
249 if (!_validate_type(vals, tp)) 252 if (!_validate_type(vals, tp, by_ref, is_ret))
250 return EINA_FALSE; 253 return EINA_FALSE;
251 254
252 return _validate_by_ref(tp, by_ref, move); 255 return _validate_by_ref(tp, by_ref, move);
253} 256}
254 257
255static Eina_Bool 258static Eina_Bool
256_validate_type(Validate_State *vals, Eolian_Type *tp) 259_validate_type(Validate_State *vals, Eolian_Type *tp, Eina_Bool by_ref,
260 Eina_Bool is_ret)
257{ 261{
258 const Eolian_Unit *src = tp->base.unit; 262 const Eolian_Unit *src = tp->base.unit;
259 263
@@ -265,7 +269,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
265 return EINA_FALSE; 269 return EINA_FALSE;
266 } 270 }
267 tp->is_ptr = EINA_FALSE; 271 tp->is_ptr = EINA_FALSE;
268 Eina_Bool still_ownable = database_type_is_ownable(src, tp, EINA_FALSE); 272 Eina_Bool still_ownable = database_type_is_ownable(src, tp, EINA_FALSE, NULL);
269 tp->is_ptr = EINA_TRUE; 273 tp->is_ptr = EINA_TRUE;
270 if (still_ownable) 274 if (still_ownable)
271 { 275 {
@@ -274,6 +278,38 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
274 } 278 }
275 } 279 }
276 280
281 if (tp->is_const && !tp->is_ptr)
282 {
283 if (database_type_is_ownable(src, tp, EINA_FALSE, NULL))
284 {
285 int kw = eo_lexer_keyword_str_to_id(tp->base.name);
286 switch (kw)
287 {
288 case KW_string:
289 case KW_mstring:
290 case KW_stringshare:
291 _eo_parser_log(&tp->base, "string types cannot be const");
292 return EINA_FALSE;
293 default:
294 {
295 if (!is_ret)
296 break;
297 const char *ct = eo_lexer_get_c_type(kw);
298 if (ct && ct[strlen(ct) - 1] != '*')
299 {
300 _eo_parser_log(&tp->base, "return const requires a C pointer");
301 return EINA_FALSE;
302 }
303 }
304 }
305 }
306 else if (!by_ref && is_ret)
307 {
308 _eo_parser_log(&tp->base, "value returns cannot be const");
309 return EINA_FALSE;
310 }
311 }
312
277 switch (tp->type) 313 switch (tp->type)
278 { 314 {
279 case EOLIAN_TYPE_VOID: 315 case EOLIAN_TYPE_VOID:
@@ -309,7 +345,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
309 tp->base.name); 345 tp->base.name);
310 return EINA_FALSE; 346 return EINA_FALSE;
311 } 347 }
312 if (!_validate_type_by_ref(vals, itp, EINA_FALSE, itp->move)) 348 if (!_validate_type_by_ref(vals, itp, EINA_FALSE, itp->move, EINA_FALSE))
313 return EINA_FALSE; 349 return EINA_FALSE;
314 itp = itp->next_type; 350 itp = itp->next_type;
315 } 351 }
@@ -398,7 +434,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
398 return EINA_FALSE; 434 return EINA_FALSE;
399 } 435 }
400 tp->base.c_name = eina_stringshare_ref(tp->error->base.c_name); 436 tp->base.c_name = eina_stringshare_ref(tp->error->base.c_name);
401 if (tp->next_type && !_validate_type(vals, tp->next_type)) 437 if (tp->next_type && !_validate_type(vals, tp->next_type, EINA_FALSE, EINA_FALSE))
402 return EINA_FALSE; 438 return EINA_FALSE;
403 return _validate(&tp->base); 439 return _validate(&tp->base);
404 } 440 }
@@ -429,7 +465,7 @@ _validate_expr(Eolian_Expression *expr, const Eolian_Type *tp,
429static Eina_Bool 465static Eina_Bool
430_validate_param(Validate_State *vals, Eolian_Function_Parameter *param) 466_validate_param(Validate_State *vals, Eolian_Function_Parameter *param)
431{ 467{
432 if (!_validate_type_by_ref(vals, param->type, param->by_ref, param->move)) 468 if (!_validate_type_by_ref(vals, param->type, param->by_ref, param->move, EINA_FALSE))
433 return EINA_FALSE; 469 return EINA_FALSE;
434 470
435 if (param->value && !_validate_expr(param->value, param->type, 0, param->by_ref)) 471 if (param->value && !_validate_expr(param->value, param->type, 0, param->by_ref))
@@ -472,11 +508,11 @@ _validate_function(Validate_State *vals, Eolian_Function *func, Eina_Hash *nhash
472 Eina_Bool was_stable = _set_stable(vals, !func->base.is_beta && vals->stable); 508 Eina_Bool was_stable = _set_stable(vals, !func->base.is_beta && vals->stable);
473 509
474 if (func->get_ret_type && !_validate_type_by_ref(vals, func->get_ret_type, 510 if (func->get_ret_type && !_validate_type_by_ref(vals, func->get_ret_type,
475 func->get_return_by_ref, func->get_return_move)) 511 func->get_return_by_ref, func->get_return_move, EINA_TRUE))
476 return _reset_stable(vals, was_stable, EINA_FALSE); 512 return _reset_stable(vals, was_stable, EINA_FALSE);
477 513
478 if (func->set_ret_type && !_validate_type_by_ref(vals, func->set_ret_type, 514 if (func->set_ret_type && !_validate_type_by_ref(vals, func->set_ret_type,
479 func->set_return_by_ref, func->set_return_move)) 515 func->set_return_by_ref, func->set_return_move, EINA_TRUE))
480 return _reset_stable(vals, was_stable, EINA_FALSE); 516 return _reset_stable(vals, was_stable, EINA_FALSE);
481 517
482 if (func->get_ret_val && !_validate_expr(func->get_ret_val, 518 if (func->get_ret_val && !_validate_expr(func->get_ret_val,
@@ -587,7 +623,7 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash)
587 623
588 Eina_Bool was_stable = _set_stable(vals, !event->base.is_beta && vals->stable); 624 Eina_Bool was_stable = _set_stable(vals, !event->base.is_beta && vals->stable);
589 625
590 if (!_validate_type(vals, event->type)) 626 if (!_validate_type(vals, event->type, EINA_FALSE, EINA_FALSE))
591 return _reset_stable(vals, was_stable, EINA_FALSE); 627 return _reset_stable(vals, was_stable, EINA_FALSE);
592 628
593 /* if this is an alias we need the lowest type in the stack, this is 629 /* if this is an alias we need the lowest type in the stack, this is
@@ -612,7 +648,7 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash)
612 * this is FIXME, and decision wasn't reached before 1.22 648 * this is FIXME, and decision wasn't reached before 1.22
613 * it is a simple search-replace anyway 649 * it is a simple search-replace anyway
614 */ 650 */
615 if (database_type_is_ownable(tp->base.unit, tp, EINA_FALSE)) 651 if (database_type_is_ownable(tp->base.unit, tp, EINA_FALSE, NULL))
616 { 652 {
617 switch (kwid) 653 switch (kwid)
618 { 654 {
@@ -1495,7 +1531,7 @@ _validate_constant(Validate_State *vals, Eolian_Constant *var)
1495 1531
1496 Eina_Bool was_stable = _set_stable(vals, !var->base.is_beta && vals->stable); 1532 Eina_Bool was_stable = _set_stable(vals, !var->base.is_beta && vals->stable);
1497 1533
1498 if (!_validate_type(vals, var->base_type)) 1534 if (!_validate_type(vals, var->base_type, EINA_FALSE, EINA_FALSE))
1499 return _reset_stable(vals, was_stable, EINA_FALSE); 1535 return _reset_stable(vals, was_stable, EINA_FALSE);
1500 1536
1501 if (!_validate_expr(var->value, var->base_type, 0, EINA_FALSE)) 1537 if (!_validate_expr(var->value, var->base_type, 0, EINA_FALSE))
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index d30d285a2c..72f5ad2f27 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -436,14 +436,14 @@ parse_expr(Eo_Lexer *ls)
436 return parse_expr_bin(ls, 1); 436 return parse_expr_bin(ls, 1);
437} 437}
438 438
439static Eolian_Type *parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr); 439static Eolian_Type *parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr, Eina_Bool allow_const);
440 440
441static Eolian_Type * 441static Eolian_Type *
442parse_type(Eo_Lexer *ls, Eina_Bool allow_ptr) 442parse_type(Eo_Lexer *ls, Eina_Bool allow_ptr, Eina_Bool allow_const)
443{ 443{
444 Eolian_Type *ret; 444 Eolian_Type *ret;
445 eo_lexer_context_push(ls); 445 eo_lexer_context_push(ls);
446 ret = parse_type_void(ls, allow_ptr); 446 ret = parse_type_void(ls, allow_ptr, allow_const);
447 if (ret->type == EOLIAN_TYPE_VOID) 447 if (ret->type == EOLIAN_TYPE_VOID)
448 { 448 {
449 eo_lexer_context_restore(ls); 449 eo_lexer_context_restore(ls);
@@ -513,7 +513,7 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
513 eolian_object_ref(&fdef->base); 513 eolian_object_ref(&fdef->base);
514 eo_lexer_get(ls); 514 eo_lexer_get(ls);
515 check_next(ls, ':'); 515 check_next(ls, ':');
516 tp = parse_type(ls, EINA_TRUE); 516 tp = parse_type(ls, EINA_TRUE, EINA_TRUE);
517 FILL_BASE(fdef->base, ls, fline, fcol, STRUCT_FIELD); 517 FILL_BASE(fdef->base, ls, fline, fcol, STRUCT_FIELD);
518 fdef->type = eo_lexer_type_release(ls, tp); 518 fdef->type = eo_lexer_type_release(ls, tp);
519 fdef->base.name = eina_stringshare_ref(fname); 519 fdef->base.name = eina_stringshare_ref(fname);
@@ -689,7 +689,7 @@ parse_type_error(Eo_Lexer *ls)
689} 689}
690 690
691static Eolian_Type * 691static Eolian_Type *
692parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr) 692parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr, Eina_Bool allow_const)
693{ 693{
694 Eolian_Type *def; 694 Eolian_Type *def;
695 Eina_Strbuf *buf; 695 Eina_Strbuf *buf;
@@ -698,12 +698,14 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr)
698 { 698 {
699 case KW_const: 699 case KW_const:
700 { 700 {
701 if (!allow_const)
702 break;
701 int pline, pcol; 703 int pline, pcol;
702 eo_lexer_get(ls); 704 eo_lexer_get(ls);
703 pline = ls->line_number; 705 pline = ls->line_number;
704 pcol = ls->column; 706 pcol = ls->column;
705 check_next(ls, '('); 707 check_next(ls, '(');
706 def = parse_type_void(ls, allow_ptr); 708 def = parse_type_void(ls, allow_ptr, EINA_FALSE);
707 FILL_BASE(def->base, ls, line, col, TYPE); 709 FILL_BASE(def->base, ls, line, col, TYPE);
708 def->is_const = EINA_TRUE; 710 def->is_const = EINA_TRUE;
709 check_match(ls, ')', '(', pline, pcol); 711 check_match(ls, ')', '(', pline, pcol);
@@ -718,7 +720,7 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr)
718 pline = ls->line_number; 720 pline = ls->line_number;
719 pcol = ls->column; 721 pcol = ls->column;
720 check_next(ls, '('); 722 check_next(ls, '(');
721 def = parse_type_void(ls, EINA_FALSE); 723 def = parse_type_void(ls, EINA_FALSE, allow_const);
722 FILL_BASE(def->base, ls, line, col, TYPE); 724 FILL_BASE(def->base, ls, line, col, TYPE);
723 def->is_ptr = EINA_TRUE; 725 def->is_ptr = EINA_TRUE;
724 check_match(ls, ')', '(', pline, pcol); 726 check_match(ls, ')', '(', pline, pcol);
@@ -768,9 +770,9 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr)
768 int bline = ls->line_number, bcol = ls->column; 770 int bline = ls->line_number, bcol = ls->column;
769 check_next(ls, '<'); 771 check_next(ls, '<');
770 if (tpid == KW_future) 772 if (tpid == KW_future)
771 def->base_type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); 773 def->base_type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE, EINA_TRUE));
772 else 774 else
773 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); 775 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE, EINA_TRUE));
774 /* view-only types are not allowed to own the contents */ 776 /* view-only types are not allowed to own the contents */
775 if (tpid == KW_array || tpid == KW_hash || tpid == KW_list || tpid == KW_future) 777 if (tpid == KW_array || tpid == KW_hash || tpid == KW_list || tpid == KW_future)
776 if ((def->base_type->move = ls->t.kw == KW_at_move)) 778 if ((def->base_type->move = ls->t.kw == KW_at_move))
@@ -779,7 +781,7 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr)
779 { 781 {
780 check_next(ls, ','); 782 check_next(ls, ',');
781 def->base_type->next_type = 783 def->base_type->next_type =
782 eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); 784 eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE, EINA_TRUE));
783 if ((def->base_type->next_type->move = ls->t.kw == KW_at_move)) 785 if ((def->base_type->next_type->move = ls->t.kw == KW_at_move))
784 eo_lexer_get(ls); 786 eo_lexer_get(ls);
785 } 787 }
@@ -872,7 +874,7 @@ tags_done:
872 } 874 }
873 eo_lexer_context_pop(ls); 875 eo_lexer_context_pop(ls);
874 check_next(ls, ':'); 876 check_next(ls, ':');
875 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_FALSE)); 877 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_FALSE, EINA_FALSE));
876 check_next(ls, ';'); 878 check_next(ls, ';');
877 FILL_DOC(ls, def, doc); 879 FILL_DOC(ls, def, doc);
878 eo_lexer_dtor_pop(ls); 880 eo_lexer_dtor_pop(ls);
@@ -929,7 +931,7 @@ tags_done:
929 } 931 }
930 eo_lexer_context_pop(ls); 932 eo_lexer_context_pop(ls);
931 check_next(ls, ':'); 933 check_next(ls, ':');
932 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); 934 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_FALSE, EINA_FALSE));
933 /* constants are required to have a value */ 935 /* constants are required to have a value */
934 check(ls, '='); 936 check(ls, '=');
935 ls->expr_mode = EINA_TRUE; 937 ls->expr_mode = EINA_TRUE;
@@ -1025,9 +1027,9 @@ parse_return(Eo_Lexer *ls, Eo_Ret_Def *ret, Eina_Bool allow_void,
1025 eo_lexer_get(ls); 1027 eo_lexer_get(ls);
1026 check_next(ls, ':'); 1028 check_next(ls, ':');
1027 if (allow_void) 1029 if (allow_void)
1028 ret->type = parse_type_void(ls, EINA_TRUE); 1030 ret->type = parse_type_void(ls, EINA_TRUE, EINA_TRUE);
1029 else 1031 else
1030 ret->type = parse_type(ls, EINA_TRUE); 1032 ret->type = parse_type(ls, EINA_TRUE, EINA_TRUE);
1031 ret->doc = NULL; 1033 ret->doc = NULL;
1032 ret->default_ret_val = NULL; 1034 ret->default_ret_val = NULL;
1033 ret->no_unused = EINA_FALSE; 1035 ret->no_unused = EINA_FALSE;
@@ -1106,11 +1108,11 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
1106 if (par->param_dir == EOLIAN_OUT_PARAM || par->param_dir == EOLIAN_INOUT_PARAM) 1108 if (par->param_dir == EOLIAN_OUT_PARAM || par->param_dir == EOLIAN_INOUT_PARAM)
1107 { 1109 {
1108 /* void is allowed for out/inout for beta-api for now to make a voidptr */ 1110 /* void is allowed for out/inout for beta-api for now to make a voidptr */
1109 par->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); 1111 par->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE, EINA_TRUE));
1110 goto type_done; 1112 goto type_done;
1111 } 1113 }
1112 } 1114 }
1113 par->type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); 1115 par->type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE, EINA_TRUE));
1114type_done: 1116type_done:
1115 if ((is_vals || (par->param_dir == EOLIAN_OUT_PARAM)) && (ls->t.token == '(')) 1117 if ((is_vals || (par->param_dir == EOLIAN_OUT_PARAM)) && (ls->t.token == '('))
1116 { 1118 {
@@ -1906,7 +1908,7 @@ parse_event(Eo_Lexer *ls)
1906 } 1908 }
1907end: 1909end:
1908 check_next(ls, ':'); 1910 check_next(ls, ':');
1909 ev->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); 1911 ev->type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE, EINA_TRUE));
1910 check(ls, ';'); 1912 check(ls, ';');
1911 eo_lexer_get(ls); 1913 eo_lexer_get(ls);
1912 FILL_DOC(ls, ev, doc); 1914 FILL_DOC(ls, ev, doc);
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index ffe8067e76..895a7ff14a 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -432,7 +432,7 @@ void database_typedecl_to_str(const Eolian_Typedecl *tp, Eina_Strbuf *buf);
432 432
433Eolian_Typedecl *database_type_decl_find(const Eolian_Unit *src, const Eolian_Type *tp); 433Eolian_Typedecl *database_type_decl_find(const Eolian_Unit *src, const Eolian_Type *tp);
434 434
435Eina_Bool database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bool allow_void); 435Eina_Bool database_type_is_ownable(const Eolian_Unit *unit, const Eolian_Type *tp, Eina_Bool allow_void, const Eolian_Type **otp);
436 436
437/* expressions */ 437/* expressions */
438 438