diff --git a/divine/mem/data.tpp b/divine/mem/data.tpp
index 24ca67e0bdb61ff18611c48159d4c51cffd60c43..89e0e26ea2be2eec7d6b3f06368fccbbd70595eb 100644
--- a/divine/mem/data.tpp
+++ b/divine/mem/data.tpp
@@ -187,7 +187,7 @@ namespace divine::mem
             else
                 -- bytes;
 
-        return Next::compare( a, b, ptr_cb, bytes );
+        return Next::compare( a, b, ptr_cb, total_bytes );
     }
 
 }