diff --git a/src/evm/cov_stage.rs b/src/evm/cov_stage.rs index 683f35c0..7130ed5b 100644 --- a/src/evm/cov_stage.rs +++ b/src/evm/cov_stage.rs @@ -167,7 +167,15 @@ where .deref() .borrow_mut() .save_trace(format!("{}/{}", self.trace_dir, i).as_str()); - + if let Some(bug_idx) = meta.corpus_idx_to_bug.get(&i.into()) { + for id in bug_idx { + fs::copy( + format!("{}/{}.json", self.trace_dir, i), + format!("{}/bug_{}.json", self.trace_dir, id), + ) + .unwrap(); + } + } unsafe { EVAL_COVERAGE = false; } diff --git a/src/fuzzer.rs b/src/fuzzer.rs index fd340fb9..ab66e70f 100644 --- a/src/fuzzer.rs +++ b/src/fuzzer.rs @@ -380,7 +380,6 @@ where + HasExecutionResult + HasExecutions + HasMetadata - + HasCurrentInputIdx + HasRand + HasLastReportTime + UsesInput, @@ -579,18 +578,6 @@ where solution::generate_test(cur_report.clone(), minimized); - unsafe { - for bug_idx in ORACLE_OUTPUT.iter().map(|v| v["bug_idx"].as_u64().unwrap()) { - let src = format!("{}/traces/{}.json", self.work_dir, &state.get_current_input_idx()); - let dest = format!("{}/traces/bug_{}.json", self.work_dir, bug_idx); - if std::fs::metadata(&src).is_ok() { - std::fs::copy(&src, &dest).unwrap(); - } else { - eprintln!("Source trace {} does not exist", src); - } - } - } - let vuln_file = format!("{}/vuln_info.jsonl", self.work_dir.as_str()); let mut f = OpenOptions::new() .create(true)