Merge commit '32a8dba185482fe1a89037bce2a5b0c5e76d4127'

This commit is contained in:
2023-11-13 14:02:43 +01:00
38 changed files with 220 additions and 81 deletions

View File

@ -28,7 +28,7 @@ cc_library(
cc_fuzz_test(
name = "bootstrap_fuzz_test",
#size = "small",
size = "small",
srcs = ["bootstrap_harness.cc"],
copts = ["-UNDEBUG"],
corpus = ["//tools/toktok-fuzzer/corpus:bootstrap_fuzzer"],
@ -43,7 +43,7 @@ cc_fuzz_test(
cc_fuzz_test(
name = "e2e_fuzz_test",
#size = "small",
size = "small",
srcs = ["e2e_fuzz_test.cc"],
copts = ["-UNDEBUG"],
corpus = ["//tools/toktok-fuzzer/corpus:e2e_fuzz_test"],
@ -59,7 +59,7 @@ cc_fuzz_test(
cc_fuzz_test(
name = "toxsave_fuzz_test",
#size = "small",
size = "small",
srcs = ["toxsave_harness.cc"],
copts = ["-UNDEBUG"],
corpus = ["//tools/toktok-fuzzer/corpus:toxsave_fuzzer"],
@ -92,7 +92,7 @@ fuzzing_binary(
cc_fuzz_test(
name = "protodump_reduce",
#size = "small",
size = "small",
srcs = ["protodump_reduce.cc"],
copts = ["-UNDEBUG"],
deps = [

View File

@ -22,6 +22,8 @@
const bool DEBUG = false;
static constexpr tox_mono_time_cb *get_self_clock = ![](Fuzz_System *self) { return self->clock; };
// TODO(iphydf): Put this somewhere shared.
struct Network_Addr {
struct sockaddr_storage addr;
@ -182,7 +184,7 @@ Fuzz_System::Fuzz_System(Fuzz_Data &input)
}
, data(input)
{
sys->mono_time_callback = ![](Fuzz_System *self) { return self->clock; };
sys->mono_time_callback = get_self_clock;
sys->mono_time_user_data = this;
sys->mem = mem.get();
sys->ns = ns.get();
@ -269,7 +271,7 @@ Null_System::Null_System()
std::make_unique<Random>(Random{&null_random_funcs, this}),
}
{
sys->mono_time_callback = ![](Fuzz_System *self) { return self->clock; };
sys->mono_time_callback = get_self_clock;
sys->mono_time_user_data = this;
sys->mem = mem.get();
sys->ns = ns.get();
@ -400,7 +402,7 @@ Record_System::Record_System(Global &global, uint64_t seed, const char *name)
, seed_(seed)
, name_(name)
{
sys->mono_time_callback = ![](Fuzz_System *self) { return self->clock; };
sys->mono_time_callback = get_self_clock;
sys->mono_time_user_data = this;
sys->mem = mem.get();
sys->ns = ns.get();