From b0ffa39cac2af955b8b39e5457e9ca8ed3e8748b Mon Sep 17 00:00:00 2001 From: David Goldblatt Date: Mon, 17 Aug 2020 09:04:33 -0700 Subject: [PATCH] Mallctl stress test: fix a type. The mallctlbymib_long helper was copy-pasted from mallctlbymib_short, and incorrectly used its output variable (a char *) rather than the output variable of the mallctl call it was using (a uint64_t), causing breakages when sizeof(char *) differed from sizeof(uint64_t). --- test/stress/mallctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/stress/mallctl.c b/test/stress/mallctl.c index 6d2e5c50..d29b3118 100644 --- a/test/stress/mallctl.c +++ b/test/stress/mallctl.c @@ -44,9 +44,9 @@ size_t mib_long[6]; static void mallctlbymib_long(void) { size_t miblen = sizeof(mib_long)/sizeof(mib_long[0]); - const char *version; - size_t sz = sizeof(version); - int err = mallctlbymib(mib_long, miblen, &version, &sz, NULL, 0); + uint64_t nmalloc; + size_t sz = sizeof(nmalloc); + int err = mallctlbymib(mib_long, miblen, &nmalloc, &sz, NULL, 0); assert_d_eq(err, 0, "mallctlbymib failure"); }