mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-01 11:36:51 +02: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,
|
GTypeCValue *collect_values,
|
||||||
guint collect_flags)
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user