From e62ae9fb949938655c251f7c40b17327a62eeae4 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 28 May 2018 23:51:10 +0200 Subject: [PATCH] Fix the iterators calculation of _splice_at. NOTE: iterator seems broken for _splice_back. To check --- m-i-list.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/m-i-list.h b/m-i-list.h index 370c5687..ae765153 100644 --- a/m-i-list.h +++ b/m-i-list.h @@ -472,7 +472,11 @@ typedef struct ilist_head_s { (void) olist, (void) nlist; \ type *obj = M_C(name, _ref)(opos); \ type *refObj = M_C(name, _ref)(npos); \ - M_C(name, _it_set)(npos, opos); \ + /* Set npos iterator to new position of object */ \ + npos->previous = &refObj->name; \ + npos->current = &obj->name; \ + npos->next = refObj->name.next; \ + /* Move iterator in old list */ \ M_C(name, _next)(opos); \ M_C(name, _unlink)(obj); \ M_C(name, _push_after)(refObj, obj); \