From cf3b76ebd38b220d604fd438bcc51175c83eeb76 Mon Sep 17 00:00:00 2001 From: nicola cabiddu Date: Fri, 24 May 2024 13:42:53 +0100 Subject: [PATCH] fix ref to fuzz object during cnf bootstrap (#7732) --- test/realm-fuzzer/fuzz_engine.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/realm-fuzzer/fuzz_engine.cpp b/test/realm-fuzzer/fuzz_engine.cpp index a4c4d4edd7c..3e4bbcd3cf1 100644 --- a/test/realm-fuzzer/fuzz_engine.cpp +++ b/test/realm-fuzzer/fuzz_engine.cpp @@ -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) { @@ -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; }