From de06df6edd100c8e514d7eb5a85582d87a07da34 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Sat, 6 Aug 2016 21:28:56 +0000 Subject: [PATCH] [libFuzzer] make libFuzzer work with a bit older clang versions llvm-svn: 277941 --- lib/Fuzzer/FuzzerLoop.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Fuzzer/FuzzerLoop.cpp b/lib/Fuzzer/FuzzerLoop.cpp index ebcf892c432..db8868c6838 100644 --- a/lib/Fuzzer/FuzzerLoop.cpp +++ b/lib/Fuzzer/FuzzerLoop.cpp @@ -123,15 +123,17 @@ class CoverageController { C->PcMapBits = NewPcMapBits; } - uint64_t NewPcBufferPos = EF->__sanitizer_get_coverage_pc_buffer_pos(); - if (NewPcBufferPos > C->PcBufferPos) { - Res = true; - C->PcBufferPos = NewPcBufferPos; - } + if (EF->__sanitizer_get_coverage_pc_buffer_pos) { + uint64_t NewPcBufferPos = EF->__sanitizer_get_coverage_pc_buffer_pos(); + if (NewPcBufferPos > C->PcBufferPos) { + Res = true; + C->PcBufferPos = NewPcBufferPos; + } - if (PcBufferLen && NewPcBufferPos >= PcBufferLen) { - Printf("ERROR: PC buffer overflow\n"); - _Exit(1); + if (PcBufferLen && NewPcBufferPos >= PcBufferLen) { + Printf("ERROR: PC buffer overflow\n"); + _Exit(1); + } } return Res;