From: Ben Pfaff Date: Sat, 18 Sep 2004 17:33:18 +0000 (+0000) Subject: Only destroy pages up to PHYS_BASE. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6a09e68f6d8b9c63adf8206777495dc3cd2a8b1;p=pintos-anon Only destroy pages up to PHYS_BASE. --- diff --git a/src/userprog/pagedir.c b/src/userprog/pagedir.c index 1bad9b2..39a8f0a 100644 --- a/src/userprog/pagedir.c +++ b/src/userprog/pagedir.c @@ -19,7 +19,7 @@ pagedir_destroy (uint32_t *pd) { uint32_t *pde; - for (pde = pd; pde < pd + PGSIZE / sizeof *pde; pde++) + for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++) if (*pde & PG_P) { uint32_t *pt = pde_get_pt (*pde);