fix that the wrong vtable is patched when CX_STORE_POINTERS is used

Wed, 27 Aug 2025 23:24:11 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 27 Aug 2025 23:24:11 +0200
changeset 1353
5a13b9c1c57b
parent 1352
8428516137dd
child 1354
b024e573dcb2

fix that the wrong vtable is patched when CX_STORE_POINTERS is used

relates to #461

src/kv_list.c file | annotate | diff | comparison | revisions
--- a/src/kv_list.c	Wed Aug 27 23:13:53 2025 +0200
+++ b/src/kv_list.c	Wed Aug 27 23:24:11 2025 +0200
@@ -228,9 +228,14 @@
     kv_map->list = kv_list;
 
     // remember the base methods and override them
-    kv_list->list_methods = list->cl;
     kv_list->map_methods = map->cl;
-    list->cl = &cx_kv_list_class;
+    if (list->climpl == NULL) {
+        kv_list->list_methods = list->cl;
+        list->cl = &cx_kv_list_class;
+    } else {
+        kv_list->list_methods = list->climpl;
+        list->climpl = &cx_kv_list_class;
+    }
     // TODO: override all map members
     //       and remember to set the sorted flag of the list to false in the put/emplace methods!
 

mercurial