@@ -165,7 +165,7 @@ static int create_symbol(uint32_t symbol_type, hashtab_key_t key, hashtab_datum_
decl->decl_id, dest_value);
if (ret == 1 && dest_value) {
- symtab_datum_t *s =
+ hashtab_datum_t s =
hashtab_search(policydbp->symtab[symbol_type].table,
key);
assert(s != NULL);
@@ -173,7 +173,7 @@ static int create_symbol(uint32_t symbol_type, hashtab_key_t key, hashtab_datum_
if (symbol_type == SYM_LEVELS) {
*dest_value = ((level_datum_t *)s)->level->sens;
} else {
- *dest_value = s->value;
+ *dest_value = ((symtab_datum_t *)s)->value;
}
} else if (ret == -2) {
return -2;
Delay the down-cast from hashtab_datum_t, alias void*, to the actual type once its kind has been determined. module_compiler.c:174:19: warning: cast from 'symtab_datum_t *' (aka 'struct symtab_datum *') to 'level_datum_t *' (aka 'struct level_datum *') increases required alignment from 4 to 8 [-Wcast-align] *dest_value = ((level_datum_t *)s)->level->sens; ^~~~~~~~~~~~~~~~~~ Signed-off-by: Christian Göttsche <cgzones@googlemail.com> --- checkpolicy/module_compiler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)