mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
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:
parent
4f81c9eb97
commit
1d6c7843ca
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user