[gjs/gnome-3-34] arg: Fix GHashTable key marshalling on 64-bit big-endian
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/gnome-3-34] arg: Fix GHashTable key marshalling on 64-bit big-endian
- Date: Tue, 28 Apr 2020 03:12:54 +0000 (UTC)
commit c29e7fd5712185930ededf7e71d30b1d9600907e
Author: Simon McVittie <smcv debian org>
Date: Tue Apr 7 08:31:32 2020 +0100
arg: Fix GHashTable key marshalling on 64-bit big-endian
Similar to the previous commit, it is not correct to write to
arg->v_pointer and then have _g_type_info_argument_from_hash_pointer()
read out a different member of the GIArgument union.
This particular change fixes conversion of GHashTable<int, x>
from GLib to JavaScript, part of #309.
Signed-off-by: Simon McVittie <smcv debian org>
gi/arg.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gi/arg.cpp b/gi/arg.cpp
index b1829d77..f7bca148 100644
--- a/gi/arg.cpp
+++ b/gi/arg.cpp
@@ -2742,8 +2742,11 @@ gjs_object_from_g_hash (JSContext *context,
JS::RootedString keystr(context);
g_hash_table_iter_init(&iter, hash);
+ void* key_pointer;
void* val_pointer;
- while (g_hash_table_iter_next(&iter, &keyarg.v_pointer, &val_pointer)) {
+ while (g_hash_table_iter_next(&iter, &key_pointer, &val_pointer)) {
+ _g_type_info_argument_from_hash_pointer(key_param_info, key_pointer,
+ &keyarg);
if (!gjs_value_from_g_argument(context, &keyjs,
key_param_info, &keyarg,
true))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]