@@ -162,7 +162,7 @@ static inline void *last_ptr_list(struct ptr_list *list)
for (__nr = 0; __nr < __list->nr; __nr++) { \
do { \
ptr = PTR_ENTRY(__list,__nr); \
- if (list->rm && !ptr) \
+ if (__list->rm && !ptr) \
continue; \
do {
@@ -185,7 +185,7 @@ static inline void *last_ptr_list(struct ptr_list *list)
while (--__nr >= 0) { \
do { \
ptr = PTR_ENTRY(__list,__nr); \
- if (list->rm && !ptr) \
+ if (__list->rm && !ptr) \
continue; \
do {
@@ -172,14 +172,15 @@ static int delete_pseudo_user_list_entry(struct pseudo_user_list **list, pseudo_
FOR_EACH_PTR(*list, pu) {
if (pu->userp == entry) {
- DELETE_CURRENT_PTR(pu);
+ MARK_CURRENT_DELETED(pu);
if (!--count)
goto out;
}
} END_FOR_EACH_PTR(pu);
assert(count <= 0);
out:
- pack_ptr_list((struct ptr_list **)list);
+ if (ptr_list_size((struct ptr_list *) *list) == 0)
+ *list = NULL;
return count;
}
This will fix the (rare) problems with deletion while doing nested ptrlist walking that occurs when doing recursive kill_instruction() - remove_usage() - kill_instruction() Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- ptrlist.h | 4 ++-- simplify.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-)