[PATCH] D69171: [clang-fuzzer] Add new fuzzer target for Objective-C

Matt Morehouse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 16:32:47 PDT 2019


morehouse added inline comments.


================
Comment at: tools/clang-fuzzer/ClangObjectiveCFuzzer.cpp:19
+
+extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { return 0; }
+
----------------
Nit:  Since it does nothing, let's omit the `LLVMFuzzerInitialize` definition.


================
Comment at: tools/clang-fuzzer/ClangObjectiveCFuzzer.cpp:22
+extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
+  std::string s((const char *)data, size);
+  HandleObjC(s, {"-O2"});
----------------
Nit: reinterpret_cast


================
Comment at: tools/clang-fuzzer/handle-objc/handle_objc.cpp:50
+                        &Diags);
+}
+
----------------
Since this is ~identical to handle_cxx, I'd like to reuse the implementation.  Can we make a more generic function (e.g., `handleLanguage(Language type, ...)`) and use it for both?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69171/new/

https://reviews.llvm.org/D69171





More information about the cfe-commits mailing list