gobject/genums.c: fix flags validation

gint -> glong conversion causes flags to be invalid if the highest bit
is set.

Closes #1572
This commit is contained in:
Arthur Demchenkov 2018-10-14 05:03:42 +03:00
parent 4f81c9eb97
commit 1d6c7843ca

View File

@ -152,7 +152,10 @@ value_flags_enum_collect_value (GValue *value,
GTypeCValue *collect_values,
guint collect_flags)
{
value->data[0].v_long = collect_values[0].v_int;
if (G_VALUE_HOLDS_ENUM (value))
value->data[0].v_long = collect_values[0].v_int;
else
value->data[0].v_ulong = (guint) collect_values[0].v_int;
return NULL;
}