/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- *vim:setts=8sts=2etsw=2tw=80:
*/ /* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
staticint testExampleInit(int* argc, char*** argv) { /* This function is called once at startup. You can use it to e.g. read environmentvariablestoinitializeadditionaloptionsyoumightneed. Notethat`gCx`and`gGlobal`arepre-initializedbytheharness.
*/ return0;
}
staticint testExampleFuzz(const uint8_t* buf, size_t size) { /* If your code directly or indirectly allocates GC memory, then it makes sensetoattemptandcollectthataftereveryiteration.Thisshoulddetect GCissuesassoonaspossible(rightafteryouriteration),ratherthan laterwhenyourcodehappenstotriggerGCcoincidentially.Youcanof coursedisablethiscode
if it is not required in your use case, which will speed up fuzzing. */ auto gcGuard = mozilla::MakeScopeExit([&] {
JS::PrepareForFullGC(gCx);
JS::NonIncrementalGC(gCx, JS::GCOptions::Normal, JS::GCReason::API);
});
/* Add code here that processes the given buffer. Whiledoingso,youneedtofollowtheserules:
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.