Going further from the previous changes, all libfuzzer_main really does is call the init function, and then proceed to call the fuzzer driver with the testing function. So instead of calling that function for it to do all that, the LibFuzzerRunner can just call the init function itself, and then call the fuzzer driver with the testing function.
22 lines
565 B
C++
22 lines
565 B
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
* * This Source Code Form is subject to the terms of the Mozilla Public
|
|
* * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "LibFuzzerRegistry.h"
|
|
|
|
namespace mozilla {
|
|
|
|
class LibFuzzerRunner {
|
|
public:
|
|
int Run(int* argc, char*** argv);
|
|
void setParams(LibFuzzerDriver aDriver);
|
|
|
|
private:
|
|
LibFuzzerDriver mFuzzerDriver;
|
|
};
|
|
|
|
extern LibFuzzerRunner* libFuzzerRunner;
|
|
|
|
} // namespace mozilla
|