Loading...
tests/malloc_realloc_large.c libmalloc-646.40.3 libmalloc-715.140.5
--- libmalloc/libmalloc-646.40.3/tests/malloc_realloc_large.c
+++ libmalloc/libmalloc-715.140.5/tests/malloc_realloc_large.c
@@ -50,7 +50,14 @@
 	void *ptr2 = realloc(ptr1, size2);
 	T_ASSERT_TRUE(memchk(ptr2, 'A', size2), "contents unchanged after realloc");
 	T_ASSERT_LE(size2, malloc_size(ptr2), "realloc LARGE smaller");
-	T_ASSERT_EQ(ptr1, ptr2, "realloc LARGE smaller in-place");
+
+	bool has_sanitizer = false;
+#if CONFIG_SANITIZER
+	has_sanitizer = malloc_sanitizer_is_enabled();
+#endif
+	if (!has_sanitizer) {
+		T_ASSERT_EQ(ptr1, ptr2, "realloc LARGE smaller in-place");
+	}
 	free(ptr2);
 
 	// Large allocation grow in place
@@ -76,9 +83,10 @@
 			"realloc HUGE smaller");
 
 #if MALLOC_TARGET_EXCLAVES
-	T_EXPECTFAIL_WITH_REASON("Exclaves don't support resizing mappings");
-#endif // MALLOC_TARGET_EXCLAVES
+	T_LOG("exclaves don't support resizing mappings, skipping realloc in-place");
+#else
 	T_ASSERT_EQ(ptr1, ptr2, "realloc HUGE smaller in-place");
+#endif // !MALLOC_TARGET_EXCLAVES
 	free(ptr2);
 
 	// Huge allocation grow in place
@@ -153,6 +161,7 @@
 		"realloc HUGE aligned");
 	free(ptr2);
 }
+
 
 T_DECL(realloc_overlap_mmap,
 		"Make sure that realloc in place doesn't overwrite existing mmap",