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=5027a84ea7bd51ec7adccf0f8ae6513e17026a6b;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);