From 3d126f21ccae72617c454ccc999e3ee93433b95c Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Mon, 8 Jan 2024 19:36:41 +0100 Subject: [PATCH] aggregator fixer (#1783) --- libafl/src/monitors/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libafl/src/monitors/mod.rs b/libafl/src/monitors/mod.rs index dd1614d31e..f2bbe0e937 100644 --- a/libafl/src/monitors/mod.rs +++ b/libafl/src/monitors/mod.rs @@ -277,6 +277,14 @@ impl UserStatsValue { let second = *y as f64 / *b as f64; Some(Self::Percent(first + second)) } + (Self::Percent(x), Self::Ratio(y, b)) => { + let ratio = *y as f64 / *b as f64; + Some(Self::Percent(*x + ratio)) + } + (Self::Ratio(x, a), Self::Percent(y)) => { + let ratio = *x as f64 / *a as f64; + Some(Self::Percent(ratio + *y)) + } _ => None, } }