Skip to content

Commit 91a29a8

Browse files
author
Artyom Ivanov
committed
fix(pag): Incorrect calculation of last used page
1 parent 1bfb317 commit 91a29a8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/jrd/pag.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,7 @@ ULONG PageSpace::lastUsedPage()
18241824

18251825
const page_inv_page* pip = (page_inv_page*) window.win_buffer;
18261826

1827-
int last_bit = pip->pip_used;
1827+
int last_bit = pip->pip_used > 0 ? pip->pip_used - 1 : 0;
18281828
int byte_num = last_bit / 8;
18291829
UCHAR mask = 1 << (last_bit % 8);
18301830
while (last_bit >= 0 && (pip->pip_bits[byte_num] & mask))

0 commit comments

Comments
 (0)