--- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -788,7 +788,7 @@ vm_map_t map; char *vec; int error; - int vecindex, lastvecindex; + vm_pindex_t vecindex, lastvecindex; vm_map_entry_t current; vm_map_entry_t entry; int mincoreinfo; @@ -826,7 +826,7 @@ * in the current processes address space, we can easily look * up the pages elsewhere. */ - lastvecindex = -1; + lastvecindex = (vm_pindex_t)-1; for (current = entry; current && current->ba.start < end; current = vm_map_rb_tree_RB_NEXT(current)) { @@ -918,7 +918,7 @@ * the byte vector is zeroed for those skipped entries. */ while((lastvecindex + 1) < vecindex) { - error = subyte( vec + lastvecindex, 0); + error = subyte(vec + lastvecindex + 1, 0); if (error) { error = EFAULT; goto done; @@ -959,7 +959,7 @@ */ vecindex = OFF_TO_IDX(end - first_addr); while((lastvecindex + 1) < vecindex) { - error = subyte( vec + lastvecindex, 0); + error = subyte(vec + lastvecindex + 1, 0); if (error) { error = EFAULT; goto done;