From b1f802cf800eec3b7523024ca955dbd56213594d Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Fri, 31 Mar 2017 03:34:33 +0000 Subject: [PATCH] [libFuzzer] ensure that strncmp is not inlined in a test llvm-svn: 299177 --- llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp b/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp index dbcc464..e5601da 100644 --- a/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp +++ b/llvm/lib/Fuzzer/test/SingleStrncmpTest.cpp @@ -9,7 +9,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { char *S = (char*)Data; - if (Size >= 6 && !strncmp(S, "qwerty", 6)) { + volatile auto Strncmp = &(strncmp); // Make sure strncmp is not inlined. + if (Size >= 6 && !Strncmp(S, "qwerty", 6)) { fprintf(stderr, "BINGO\n"); exit(1); } -- 2.7.4