From 3260cdfffbf00f33923f5f9f6bef45932d7ac28b Mon Sep 17 00:00:00 2001 From: Liang Li Date: Wed, 7 Feb 2018 11:35:49 -0500 Subject: hbitmap: fix missing restore count when finish deserialization The .count of HBitmap is forgot to set in function hbitmap_deserialize_finish, let's set it to the right value. Cc: Vladimir Sementsov-Ogievskiy Cc: Fam Zheng Cc: Max Reitz Cc: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Weiping Zhang Signed-off-by: Liang Li Reviewed-by: John Snow Message-id: 20180118131308.GA2181@liangdeMacBook-Pro.local Signed-off-by: John Snow --- util/hbitmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/hbitmap.c b/util/hbitmap.c index 289778a55c..58a2c93842 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -630,6 +630,7 @@ void hbitmap_deserialize_finish(HBitmap *bitmap) } bitmap->levels[0][0] |= 1UL << (BITS_PER_LONG - 1); + bitmap->count = hb_count_between(bitmap, 0, bitmap->size - 1); } void hbitmap_free(HBitmap *hb) -- cgit v1.2.3