diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c
index 80923611bb368933b33490f7397fc0ada65b5a71..3eb5b1d0d5e2394907ce69310f80a32b374642a8 100644
--- a/src/backend/access/hash/hash.c
+++ b/src/backend/access/hash/hash.c
@@ -897,7 +897,7 @@ hashbucketcleanup(Relation rel, Bucket cur_bucket, Buffer bucket_buf,
 			 * flag.
 			 */
 			if (tuples_removed && *tuples_removed > 0 &&
-				opaque->hasho_flag & LH_PAGE_HAS_DEAD_TUPLES)
+				H_HAS_DEAD_TUPLES(opaque))
 			{
 				opaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES;
 				clear_dead_marking = true;