From a84a6c1e484e40a2b37c0f95cc9c88a466c078d7 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Fri, 4 Aug 2017 23:49:53 +0000 Subject: [libFuzzer] use the in-binary pc table (instead of PCs captured at run-time) to implement -exit_on_src_pos llvm-svn: 310151 --- llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp') diff --git a/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp b/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp index d0954296362..1957c1f90fc 100644 --- a/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp +++ b/llvm/lib/Fuzzer/test/ShrinkControlFlowTest.cpp @@ -10,6 +10,10 @@ static volatile int Sink; +void Foo() { + Sink++; +} + extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { int8_t Ids[256]; memset(Ids, -1, sizeof(Ids)); @@ -20,8 +24,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { int U = Ids[(unsigned char)'U']; int Z = Ids[(unsigned char)'Z']; if (F >= 0 && U > F && Z > U) { - Sink++; - //fprintf(stderr, "IDS: %d %d %d\n", F, U, Z); + Foo(); } return 0; } -- cgit v1.2.3