[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC338943: LLVM Proto Fuzzer - Run Functions on Suite of Inputs (authored by emmettneyman, committed by ). Changed prior to commit: https://reviews.llvm.org/D50194?vs=159151&id=159152#toc Repository: rC

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman updated this revision to Diff 159151. emmettneyman added a comment. ready to land Repository: rC Clang https://reviews.llvm.org/D50194 Files: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp clang/tools/clang-fuzzer/handle-llvm/handle_llvm.h clang/tools/clang-fuzzer/ha

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman updated this revision to Diff 159146. emmettneyman added a comment. New input arrays and minor fixes Repository: rC Clang https://reviews.llvm.org/D50194 Files: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp clang/tools/clang-fuzzer/handle-llvm/handle_llvm.h clang/to

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse accepted this revision. morehouse added inline comments. This revision is now accepted and ready to land. Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:132 +// Takes a string of IR and compiles it using LLVM's JIT Engine +static void CreateJITFunc(con

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman updated this revision to Diff 159100. emmettneyman added a comment. Added static to some functions, made small fixes Repository: rC Clang https://reviews.llvm.org/D50194 Files: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp clang/tools/clang-fuzzer/handle-llvm/handle_l

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman added inline comments. Comment at: clang/tools/clang-fuzzer/handle-llvm/input_arrays.h:36 + {1, 1, 2, 3, 2, 3, 0, 11, 10, 0, 7, 5, 3, 1, 18, 18, 18, 18, 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse added a comment. In https://reviews.llvm.org/D50194#1187756, @emmettneyman wrote: > An unrelated question: > Right now I have a mix of `static` and non-`static` functions in > `handle_llvm.cpp`. Should they all be `static`? Any functions that are only used in the same file can and s

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse added inline comments. Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:75 +// Helper function to print error message and stop the fuzzer void ErrorAndExit(std::string message) { Unnecessary comment. The naming and implementation of

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Kostya Serebryany via Phabricator via cfe-commits
kcc added inline comments. Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:128 +void RunFuncOnInputs(LLVMFunc f, int x) { + if (x) { +for (int i = 0; i < NumArrays; i++) looks like code duplication, also strange name for a variable: 'x'. Ca

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman updated this revision to Diff 159083. emmettneyman added a comment. Refactored code to avoid memcpy-ing function Repository: rC Clang https://reviews.llvm.org/D50194 Files: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp clang/tools/clang-fuzzer/handle-llvm/handle_llvm.

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman added a comment. An unrelated question: Right now I have a mix of `static` and non-`static` functions in `handle_llvm.cpp`. Should they all be `static`? Repository: rC Clang https://reviews.llvm.org/D50194 ___ cfe-commits mailing li

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-03 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman added inline comments. Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:173 + int s = getSize((char *) func_ptr); + memcpy(mem, func_ptr, s); +} morehouse wrote: > emmettneyman wrote: > > morehouse wrote: > > > Why do we need to cop

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-02 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse added inline comments. Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:173 + int s = getSize((char *) func_ptr); + memcpy(mem, func_ptr, s); +} emmettneyman wrote: > morehouse wrote: > > Why do we need to copy the function somewhere e

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-02 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman updated this revision to Diff 158800. emmettneyman added a comment. Replaced hardcoded numbers with variables Repository: rC Clang https://reviews.llvm.org/D50194 Files: clang/tools/clang-fuzzer/CMakeLists.txt clang/tools/clang-fuzzer/ExampleClangLLVMProtoFuzzer.cpp clang/

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-02 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman added inline comments. Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:173 + int s = getSize((char *) func_ptr); + memcpy(mem, func_ptr, s); +} morehouse wrote: > Why do we need to copy the function somewhere else? Looks very erro

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-02 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse added inline comments. Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:173 + int s = getSize((char *) func_ptr); + memcpy(mem, func_ptr, s); +} Why do we need to copy the function somewhere else? Looks very error-prone and unnecessa

[PATCH] D50194: LLVM Proto Fuzzer - Run Functions on Suite of Inputs

2018-08-02 Thread Emmett Neyman via Phabricator via cfe-commits
emmettneyman created this revision. emmettneyman added reviewers: kcc, morehouse. Herald added subscribers: cfe-commits, mgorny. Added corpus of arrays to use as inputs for the functions. Check that the two functions modify the inputted arrays in the same way. Repository: rC Clang https://rev