[glib/glib-2-58: 1/3] gobject/genums.c: fix flags validation
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-58: 1/3] gobject/genums.c: fix flags validation
- Date: Thu, 1 Nov 2018 15:34:22 +0000 (UTC)
commit 6f8a12ca0faaebfb47a3f77b8f0441b95b0a045f
Author: Arthur Demchenkov <spinal by gmail com>
Date: Sun Oct 14 05:03:42 2018 +0300
gobject/genums.c: fix flags validation
gint -> glong conversion causes flags to be invalid if the highest bit
is set.
Closes #1572
gobject/genums.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gobject/genums.c b/gobject/genums.c
index 8212dd99d..aa27c6bb4 100644
--- a/gobject/genums.c
+++ b/gobject/genums.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]