From 121798fdb5561bc8e9c6a56d18a7edc7b7d2d53d Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 6 Jul 2022 18:39:52 -0700 Subject: [PATCH] [sanitizer] Fix dn_expand test res is not the size of expanded string. --- compiler-rt/test/msan/Linux/dn_expand.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler-rt/test/msan/Linux/dn_expand.cpp b/compiler-rt/test/msan/Linux/dn_expand.cpp index a7b2b37562ed..79399bf22c23 100644 --- a/compiler-rt/test/msan/Linux/dn_expand.cpp +++ b/compiler-rt/test/msan/Linux/dn_expand.cpp @@ -17,7 +17,8 @@ void testWrite() { sizeof(output)); assert(res >= 0); - __msan_check_mem_is_initialized(output, res); + assert(strlen(output) == 11); + __msan_check_mem_is_initialized(output, strlen(output) + 1); } void testWriteZeroLength() { @@ -31,6 +32,8 @@ void testWriteZeroLength() { sizeof(output)); assert(res >= 0); + assert(strlen(output) == 0); + __msan_check_mem_is_initialized(output, strlen(output) + 1); __msan_check_mem_is_initialized(output, res); }