[PATCH] D20943: [LibFuzzer] [WIP] Declare and use sanitizer functions in `fuzzer::ExternalFunctions`
Dan Liew via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 21:46:37 PDT 2016
delcypher added inline comments.
================
Comment at: lib/Fuzzer/FuzzerDriver.cpp:428
@@ +427,3 @@
+// Storage for global ExternalFunctions object.
+ExternalFunctions EF;
+
----------------
kcc wrote:
> delcypher wrote:
> > kcc wrote:
> > > make this ExternalFunctions *EF
> > We could also use `std::unique_ptr<ExternalFunctions>` instead or are you fine with an explicit delete?
> I am *not* ok with std::unique_ptr<ExternalFunctions>
> And there is no need for an explicit delete.
> Just
> EF = new .... ;
> in main is enough
>
> In tests you may have new/delete or even
> std::unique_ptr<ExternalFunctions> t;
> EF = t.get()
> I am *not* ok with std::unique_ptr<ExternalFunctions>
> And there is no need for an explicit delete.
> Just
>
> EF = new .... ;
> in main is enough
I don't understand. Why do you want a deliberate leak?
> In tests you may have new/delete or even
>
> std::unique_ptr<ExternalFunctions> t;
> EF = t.get()
Again I don't understand. Why would I want to assign nullptr (that is what `t.get()` would return here) to `EF`?
http://reviews.llvm.org/D20943
More information about the llvm-commits
mailing list