From fd98eabfbfb3fb8ed9782f6a8c5a62940658ac17 Mon Sep 17 00:00:00 2001 From: Addison Crump Date: Fri, 3 Nov 2023 17:32:48 +0100 Subject: [PATCH] clamp last to infinity to handle rare imprecision issues (#1532) --- libafl_bolts/src/math.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libafl_bolts/src/math.rs b/libafl_bolts/src/math.rs index dec9a2f3d8..a794a0e1bf 100644 --- a/libafl_bolts/src/math.rs +++ b/libafl_bolts/src/math.rs @@ -29,7 +29,7 @@ pub fn calculate_cumulative_distribution_in_place(probabilities: &mut [f32]) -> } // Clamp the end of the vector to account for floating point errors. - *last = 1.0_f32; + *last = f32::INFINITY; Ok(()) }