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 else? Looks very error-prone > > and unnecessary. Also makes this patch larger than it needs to be. > I'm copying the functions because otherwise, the generated machine code gets > lost as soon as we exit that function's scope. So I'd have to run the > functions inside `CreateJITFunction` if I don't copy it. > > I thought about doing it this way: moving the code from `RunFuncsOnInputs` to > the bottom of `CreateJITFunction` and then comparing the arrays after both > calls to `CreateJITFunction` inside `HandleLLVM`. Do you think that would be > cleaner? Or just increase the scope of `EE`. Repository: rC Clang https://reviews.llvm.org/D50194 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits