Improve page table defragmentation logic.
All entries in a table should be defragmented even once it is known that
the table itself will not be able to merge. Care must also be taken to
ensure an entry is present before making further use of its properties.
Change-Id: I513bca451449628704ecc18e3f15e8bcc52197cc
diff --git a/src/mm_test.cc b/src/mm_test.cc
index 4a523c8..e16ad91 100644
--- a/src/mm_test.cc
+++ b/src/mm_test.cc
@@ -864,7 +864,7 @@
ASSERT_TRUE(mm_vm_init(&ptable, &ppool));
ASSERT_TRUE(mm_vm_identity_map(&ptable, l0_begin, l0_end, mode, nullptr,
&ppool));
- ASSERT_TRUE(mm_vm_identity_map(&ptable, l0_begin, l0_end, mode, nullptr,
+ ASSERT_TRUE(mm_vm_identity_map(&ptable, l1_begin, l1_end, mode, nullptr,
&ppool));
ASSERT_TRUE(mm_vm_unmap(&ptable, l0_begin, l0_end, &ppool));
ASSERT_TRUE(mm_vm_unmap(&ptable, l1_begin, l1_end, &ppool));