From f906201dcb48d0dea44ecd1104373bd4b7f83334 Mon Sep 17 00:00:00 2001 From: Dongjia Zhang Date: Sat, 26 Mar 2022 21:49:17 +0900 Subject: [PATCH] Calibration fix (#578) * fix * fix * fix * fix * fmt --- libafl/src/stages/calibrate.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libafl/src/stages/calibrate.rs b/libafl/src/stages/calibrate.rs index 0ddc5b9d80..46e59e0da7 100644 --- a/libafl/src/stages/calibrate.rs +++ b/libafl/src/stages/calibrate.rs @@ -58,6 +58,22 @@ where mgr: &mut EM, corpus_idx: usize, ) -> Result<(), Error> { + // Run this stage only once for each corpus entry + if state + .corpus() + .get(corpus_idx)? + .borrow_mut() + .metadata() + .get::() + .ok_or_else(|| { + Error::KeyNotFound("PowerScheduleTescaseMetatdata not found".to_string()) + })? + .fuzz_level() + > 0 + { + return Ok(()); + } + let mut iter = self.stage_max; let handicap = state .metadata()