summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilos Nikic <nikic.milos@google.com>2025-06-24 00:58:44 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-06-24 15:10:03 +0200
commit4687a5fffa8bf611294dac3854a882c37b21f9ab (patch)
treef6e8644dfaeaea5533a49346e31eb34e206e7685
parent0bb929fab7a2689ec9ec1e55fe4765a54a39c46c (diff)
i386 kern: fix overflow in vm_object_print_part call
The call to vm_object_print_part was passing 0ULL and ~0ULL for offset and size, respectively. These values are 64-bit (unsigned long long), which causes compiler warnings when building for 32-bit platforms where vm_offset_t and vm_size_t are typedefs of uintptr_t (i.e., unsigned int). This patch replaces those constants with 0 and UINTPTR_MAX, which match the expected types and avoid implicit conversion or overflow warnings. No functional change. Message-ID: <20250623235844.763-1-nikic.milos@gmail.com>
-rw-r--r--vm/vm_object.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm/vm_object.c b/vm/vm_object.c
index 2dba76b1..c7714a44 100644
--- a/vm/vm_object.c
+++ b/vm/vm_object.c
@@ -35,6 +35,7 @@
#include <kern/printf.h>
#include <string.h>
+#include <stdint.h>
#include <mach/memory_object.h>
#include <vm/memory_object_default.user.h>
@@ -3050,7 +3051,7 @@ void vm_object_print_part(
void vm_object_print(
vm_object_t object)
{
- vm_object_print_part(object, 0ULL, ~0ULL);
+ vm_object_print_part(object, 0, UINTPTR_MAX);
}
#endif /* MACH_KDB */