[PATCH] D54780: [llvm-demangle-fuzzer] Also fuzz microsoftDemangle().
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 4 16:42:58 PST 2019
morehouse updated this revision to Diff 180340.
morehouse added a comment.
Herald added a subscriber: mgorny.
- Separate fuzz targets.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54780/new/
https://reviews.llvm.org/D54780
Files:
llvm/tools/llvm-demangle-fuzzer/CMakeLists.txt
llvm/tools/llvm-demangle-fuzzer/DummyDemanglerFuzzer.cpp
llvm/tools/llvm-demangle-fuzzer/llvm-demangle-fuzzer.cpp
llvm/tools/llvm-itanium-demangle-fuzzer/CMakeLists.txt
llvm/tools/llvm-itanium-demangle-fuzzer/DummyDemanglerFuzzer.cpp
llvm/tools/llvm-itanium-demangle-fuzzer/llvm-itanium-demangle-fuzzer.cpp
llvm/tools/llvm-microsoft-demangle-fuzzer/CMakeLists.txt
llvm/tools/llvm-microsoft-demangle-fuzzer/DummyDemanglerFuzzer.cpp
llvm/tools/llvm-microsoft-demangle-fuzzer/llvm-microsoft-demangle-fuzzer.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;
}
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:
===================================================================
--- /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
)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54780.180340.patch
Type: text/x-patch
Size: 2621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190105/4630c19a/attachment.bin>
More information about the llvm-commits
mailing list