From 8e1761e72e399e84753e175ec8793cf1952393e1 Mon Sep 17 00:00:00 2001 From: Camsyn Date: Thu, 24 Jul 2025 22:06:32 +0800 Subject: [PATCH] [MSan] Fix check overflow in a test case Previously, msan_check_mem_is_initialized.cpp initialized a stack array with size of 32-byte, but check the shaodw for offset range [12, 42), exceeding the stack array size. MSan does not guarantee that the shadow corresponding to the overflow part is 0, so it is undefined to require the overflow part to be unpoisoned --- compiler-rt/test/msan/msan_check_mem_is_initialized.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp b/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp index aaf5737ebe236..aab31893e01bc 100644 --- a/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp +++ b/compiler-rt/test/msan/msan_check_mem_is_initialized.cpp @@ -12,7 +12,7 @@ int main(void) { __msan_poison(p + 10, 2); __msan_check_mem_is_initialized(p, 10); - __msan_check_mem_is_initialized(p + 12, 30); + __msan_check_mem_is_initialized(p + 12, 20); #ifdef POSITIVE __msan_check_mem_is_initialized(p + 5, 20); // CHECK: Uninitialized bytes in __msan_check_mem_is_initialized at offset 5 inside [0x{{.*}}, 20)