Skip to content

Commit

Permalink
fix ref to fuzz object during cnf bootstrap (#7732)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola-cab authored May 24, 2024
1 parent 50a9895 commit cf3b76e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/realm-fuzzer/fuzz_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static const char* to_hex(char c)
int FuzzEngine::run_fuzzer(const std::string& input, const std::string& name, bool enable_logging,
const std::string& path)
{
auto configure = [&](auto fuzzer) {
auto configure = [&](auto& fuzzer) {
try {
FuzzConfigurator cnf(fuzzer, input, false, name);
if (enable_logging) {
Expand All @@ -52,16 +52,19 @@ int FuzzEngine::run_fuzzer(const std::string& input, const std::string& name, bo
return cnf;
}
catch (const EndOfFile& e) {
throw std::runtime_error{"Realm cnf is invalid"};
throw e;
}
};

try {
FuzzObject fuzzer;
auto cnf = configure(fuzzer);
FuzzConfigurator cnf = configure(fuzzer);
REALM_ASSERT(&fuzzer == &cnf.get_fuzzer());
do_fuzz(cnf);
}
catch (const EndOfFile&) {
catch (const EndOfFile& e) {
}
catch (...) {
}
return 0;
}
Expand Down

0 comments on commit cf3b76e

Please sign in to comment.