aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/memcmp_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/memcmp_test.cc')
-rw-r--r--test/asan/TestCases/memcmp_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/asan/TestCases/memcmp_test.cc b/test/asan/TestCases/memcmp_test.cc
index 3b3b8894b73c..0dd9820f52ab 100644
--- a/test/asan/TestCases/memcmp_test.cc
+++ b/test/asan/TestCases/memcmp_test.cc
@@ -7,8 +7,8 @@
#include <string.h>
int main(int argc, char **argv) {
- char a1[] = {argc, 2, 3, 4};
- char a2[] = {1, 2*argc, 3, 4};
+ char a1[] = {static_cast<char>(argc), 2, 3, 4};
+ char a2[] = {1, static_cast<char>(2*argc), 3, 4};
int res = memcmp(a1, a2, 4 + argc); // BOOM
// CHECK: AddressSanitizer: stack-buffer-overflow
// CHECK: {{#0.*memcmp}}