girparser: Fix a strict-aliasing warning with g_clear_pointer()

Casting the type for a `g_clear_pointer()` call breaks strict aliasing
rules.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall
2025-04-03 15:37:53 +01:00
parent 29e27d8dcd
commit d854836aff

View File

@@ -2401,7 +2401,11 @@ end_type_recurse (ParseContext *ctx)
else
g_assert_not_reached ();
}
g_clear_pointer ((GIIrNode **) &param, gi_ir_node_free);
if (param != NULL)
gi_ir_node_free ((GIIrNode *) param);
param = NULL;
g_list_free_full (ctx->type_parameters, (GDestroyNotify) gi_ir_node_free);
ctx->type_parameters = (GList *)ctx->type_stack->data;
ctx->type_stack = g_list_delete_link (ctx->type_stack, ctx->type_stack);