summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-01-28 15:50:05 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2019-02-28 01:09:02 +0100
commit57d8f24016f32961e97e3eac9c188da8da0c26a4 (patch)
tree221d94d0ec06acfa68dad3b5d42faa7b0a313bb3
parent53a80761db24abf9b7501011f5e0bb80d8dbf996 (diff)
eolian: make sure inlist/inarray only take value types
While technically valid, it doesn't make sense for inlist/inarray to contain non-value types, as then one might as well just use a list.
-rw-r--r--src/lib/eolian/database_validate.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 09ca6e5de3..4d3ae294c3 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -277,6 +277,19 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
277 if (tp->base_type) 277 if (tp->base_type)
278 { 278 {
279 int kwid = eo_lexer_keyword_str_to_id(tp->base.name); 279 int kwid = eo_lexer_keyword_str_to_id(tp->base.name);
280 if (kwid == KW_inlist || kwid == KW_inarray)
281 {
282 if (database_type_is_ownable(src, tp->base_type, EINA_FALSE))
283 {
284 _eo_parser_log(&tp->base_type->base,
285 "%s can only contain value types (%s)",
286 tp->base.name, tp->base_type->base.name);
287 return EINA_FALSE;
288 }
289 if (!_validate_type(vals, tp->base_type))
290 return EINA_FALSE;
291 return _validate(&tp->base);
292 }
280 if (!tp->freefunc && kwid > KW_void) 293 if (!tp->freefunc && kwid > KW_void)
281 { 294 {
282 tp->freefunc = eina_stringshare_add(eo_complex_frees[ 295 tp->freefunc = eina_stringshare_add(eo_complex_frees[