Index: =================================================================== --- /dev/null +++ /dev/null @@ -1,19 +0,0 @@ -//===--- DummyDemanglerMain.cpp - Entry point to sanity check the fuzzer --===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Implementation of main so we can build and test without linking libFuzzer. -// -//===----------------------------------------------------------------------===// - -#include "llvm/FuzzMutate/FuzzerCLI.h" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); -int main(int argc, char *argv[]) { - return llvm::runFuzzerOnInputs(argc, argv, LLVMFuzzerTestOneInput); -} Index: llvm/tools/llvm-itanium-demangle-fuzzer/CMakeLists.txt =================================================================== --- llvm/tools/llvm-itanium-demangle-fuzzer/CMakeLists.txt +++ llvm/tools/llvm-itanium-demangle-fuzzer/CMakeLists.txt @@ -4,7 +4,7 @@ Support ) -add_llvm_fuzzer(llvm-demangle-fuzzer - llvm-demangle-fuzzer.cpp +add_llvm_fuzzer(llvm-itanium-demangle-fuzzer + llvm-itanium-demangle-fuzzer.cpp DUMMY_MAIN DummyDemanglerFuzzer.cpp ) Index: llvm/tools/llvm-microsoft-demangle-fuzzer/CMakeLists.txt =================================================================== --- llvm/tools/llvm-microsoft-demangle-fuzzer/CMakeLists.txt +++ llvm/tools/llvm-microsoft-demangle-fuzzer/CMakeLists.txt @@ -4,7 +4,7 @@ Support ) -add_llvm_fuzzer(llvm-demangle-fuzzer - llvm-demangle-fuzzer.cpp +add_llvm_fuzzer(llvm-microsoft-demangle-fuzzer + llvm-microsoft-demangle-fuzzer.cpp DUMMY_MAIN DummyDemanglerFuzzer.cpp ) Index: llvm/tools/llvm-microsoft-demangle-fuzzer/llvm-microsoft-demangle-fuzzer.cpp =================================================================== --- llvm/tools/llvm-microsoft-demangle-fuzzer/llvm-microsoft-demangle-fuzzer.cpp +++ llvm/tools/llvm-microsoft-demangle-fuzzer/llvm-microsoft-demangle-fuzzer.cpp @@ -15,10 +15,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { std::string NullTerminatedString((const char *)Data, Size); - int status = 0; - if (char *demangle = llvm::itaniumDemangle(NullTerminatedString.c_str(), nullptr, - nullptr, &status)) - free(demangle); - + free(llvm::microsoftDemangle(NullTerminatedString.c_str(), nullptr, nullptr, + nullptr)); return 0; }