feat: add sanity checks to update branch of page_insert

This commit is contained in:
2024-12-04 22:04:27 +00:00
parent c0ff53beff
commit 4efc9c8e3e

View File

@@ -63,9 +63,9 @@ page_insert (struct file *file, off_t ofs, void *upage, uint32_t read_bytes,
struct page_entry *existing = page_get (upage); struct page_entry *existing = page_get (upage);
if (existing != NULL) if (existing != NULL)
{ {
existing->read_bytes = read_bytes; ASSERT (existing->read_bytes == read_bytes);
existing->zero_bytes = zero_bytes; ASSERT (existing->zero_bytes == zero_bytes);
existing->writable = writable; existing->writable = existing->writable || writable;
return existing; return existing;
} }