summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-01-29 19:46:29 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2019-02-28 01:09:02 +0100
commit899f6e864c055967c90b813f7495b1f3c66d75c2 (patch)
tree5519152ec66b903af3fa8c0c0bbf865b2930b239
parent765f16410c136b9b92b5069bf35ac943a437d814 (diff)
eolian: prevent inlist structs from being found in normal lookups
We don't want to be able to make aliases to inlist structs and stuff as they're potentially internal/not really present in public API.
-rw-r--r--src/lib/eolian/database_type.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index d629a44395..0fc859401d 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -257,7 +257,7 @@ Eolian_Typedecl *database_type_decl_find(const Eolian_Unit *unit, const Eolian_T
257{ 257{
258 if (tp->type != EOLIAN_TYPE_REGULAR) 258 if (tp->type != EOLIAN_TYPE_REGULAR)
259 return NULL; 259 return NULL;
260 if (tp->tdecl) 260 if (tp->tdecl && tp->tdecl->type != EOLIAN_TYPEDECL_STRUCT_INLIST)
261 return tp->tdecl; 261 return tp->tdecl;
262 /* try looking up if it belongs to a struct, enum or an alias... otherwise 262 /* try looking up if it belongs to a struct, enum or an alias... otherwise
263 * return NULL, but first check for builtins 263 * return NULL, but first check for builtins
@@ -267,7 +267,12 @@ Eolian_Typedecl *database_type_decl_find(const Eolian_Unit *unit, const Eolian_T
267 { 267 {
268 Eolian_Object *decl = eina_hash_find(unit->objects, tp->base.name); 268 Eolian_Object *decl = eina_hash_find(unit->objects, tp->base.name);
269 if (decl && decl->type == EOLIAN_OBJECT_TYPEDECL) 269 if (decl && decl->type == EOLIAN_OBJECT_TYPEDECL)
270 return (Eolian_Typedecl *)decl; 270 {
271 Eolian_Typedecl *ret = (Eolian_Typedecl *)decl;
272 if (ret->type == EOLIAN_TYPEDECL_STRUCT_INLIST)
273 return NULL;
274 return ret;
275 }
271 } 276 }
272 return NULL; 277 return NULL;
273} 278}