[compiler-rt] bf0d060 - [compiler-rt][MSAN][test] Update buffersize for UTF-8 to C convert

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 15:13:04 PDT 2020


Author: Jinsong Ji
Date: 2020-07-13T22:12:55Z
New Revision: bf0d060fd4ea1221fdac154e3404e448709e31aa

URL: https://github.com/llvm/llvm-project/commit/bf0d060fd4ea1221fdac154e3404e448709e31aa
DIFF: https://github.com/llvm/llvm-project/commit/bf0d060fd4ea1221fdac154e3404e448709e31aa.diff

LOG: [compiler-rt][MSAN][test] Update buffersize for UTF-8 to C convert

This is exposed by https://reviews.llvm.org/D83486.
When the host is UTF8, we may get n >10, causing assert failure.
Increase the buffersize to support UTF-8 to C conversion.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D83719

Added: 
    

Modified: 
    compiler-rt/test/msan/strxfrm.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/msan/strxfrm.cpp b/compiler-rt/test/msan/strxfrm.cpp
index 94b8c7024090..d40b56b234cd 100644
--- a/compiler-rt/test/msan/strxfrm.cpp
+++ b/compiler-rt/test/msan/strxfrm.cpp
@@ -7,7 +7,7 @@
 #include <string.h>
 
 int main(void) {
-  char q[10];
+  char q[30];
   size_t n = strxfrm(q, "abcdef", sizeof(q));
   assert(n < sizeof(q));
   __msan_check_mem_is_initialized(q, n + 1);


        


More information about the llvm-commits mailing list