vspace_mmu_aware: fixed edge case in assertions.
authorSimon Gerber <simon.gerber@hp.com>
Tue, 22 Jul 2014 01:05:57 +0000 (18:05 -0700)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 4 May 2015 09:28:13 +0000 (11:28 +0200)
Assertions didn't allow freeing the region starting at offset zero in the
vregion.

Signed-off-by: Simon Gerber <simon.gerber@hp.com>

lib/barrelfish/vspace/mmu_aware.c

index b5f4cd5..8e6642b 100644 (file)
@@ -222,11 +222,11 @@ errval_t vspace_mmu_aware_unmap(struct vspace_mmu_aware *state,
     genvaddr_t min_offset = 0;
     bool success = false;
 
-    assert(vspace_lvaddr_to_genvaddr(base) > vregion_get_base_addr(&state->vregion));
+    assert(vspace_lvaddr_to_genvaddr(base) >= vregion_get_base_addr(&state->vregion));
     assert(base + bytes == (lvaddr_t)eaddr);
 
-    assert(bytes < state->consumed);
-    assert(bytes < state->offset);
+    assert(bytes <= state->consumed);
+    assert(bytes <= state->offset);
 
     // Reduce offset
     state->offset -= bytes;