projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use 0xcc (not 0xcd) for clearing malloc() blocks too.
[pintos-anon]
/
src
/
userprog
/
pagedir.c
diff --git
a/src/userprog/pagedir.c
b/src/userprog/pagedir.c
index fa8f244d88220a954e43ebc880e1140d242643f4..937f433da030505e701d00f7a9bb8a15feb49dcb 100644
(file)
--- a/
src/userprog/pagedir.c
+++ b/
src/userprog/pagedir.c
@@
-121,7
+121,9
@@
void *
pagedir_get_page (uint32_t *pd, const void *uaddr)
{
uint32_t *pte = lookup_page (pd, (void *) uaddr, false);
pagedir_get_page (uint32_t *pd, const void *uaddr)
{
uint32_t *pte = lookup_page (pd, (void *) uaddr, false);
- return pte != NULL && *pte != 0 ? pte_get_page (*pte) : NULL;
+ return (pte != NULL && *pte != 0
+ ? (uint8_t *) pte_get_page (*pte) + pg_ofs (uaddr)
+ : NULL);
}
/* Clears any mapping for user virtual address UPAGE in page
}
/* Clears any mapping for user virtual address UPAGE in page