From: Ben Pfaff Date: Fri, 5 Nov 2004 23:43:14 +0000 (+0000) Subject: Fix bug caused by previous change. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=101845b2c3153f417f90e1c2809154187bfc9e54;p=pintos-anon Fix bug caused by previous change. --- diff --git a/src/lib/kernel/list.c b/src/lib/kernel/list.c index 1735576..ba4fae6 100644 --- a/src/lib/kernel/list.c +++ b/src/lib/kernel/list.c @@ -232,8 +232,9 @@ list_remove (list_elem *elem) list_elem * list_pop_front (struct list *list) { - ASSERT (list != NULL); - return list_remove (list_front (list)); + list_elem *front = list_front (list); + list_remove (front); + return front; } /* Removes the back element from LIST and returns it. @@ -241,8 +242,9 @@ list_pop_front (struct list *list) list_elem * list_pop_back (struct list *list) { - ASSERT (list != NULL); - return list_remove (list_back (list)); + list_elem *back = list_back (list); + list_remove (back); + return back; } /* Returns the front element in LIST.