Fix libafl_targets

This commit is contained in:
Andrea Fioraldi 2021-06-17 10:55:12 +02:00
parent e0fbe5bca2
commit 5d49933a23
2 changed files with 5 additions and 5 deletions

View File

@ -68,9 +68,9 @@ pub const CMPLOG_MAP_H: usize = {};
}
sancov_cmp
.define("CMP_MAP_SIZE", format!("{}", cmp_map_size))
.define("CMPLOG_MAP_W", format!("{}", cmplog_map_w))
.define("CMPLOG_MAP_H", format!("{}", cmplog_map_h))
.define("CMP_MAP_SIZE", Some(&*format!("{}", cmp_map_size)))
.define("CMPLOG_MAP_W", Some(&*format!("{}", cmplog_map_w)))
.define("CMPLOG_MAP_H", Some(&*format!("{}", cmplog_map_h)))
.file(_src_dir.join("sancov_cmp.c"))
.compile("sancov_cmp");
}

View File

@ -1,6 +1,6 @@
//! [`LLVM` `PcGuard`](https://clang.llvm.org/docs/SanitizerCoverage.html#tracing-pcs-with-guards) runtime for `LibAFL`.
use crate::coverage::{EDGES_MAP, EDGES_MAP_SIZE, MAX_EDGES_NUM};
use crate::coverage::{EDGES_MAP, MAX_EDGES_NUM};
#[cfg(all(feature = "sancov_pcguard_edges", feature = "sancov_pcguard_hitcounts"))]
#[cfg(not(any(doc, feature = "clippy")))]
@ -42,7 +42,7 @@ pub unsafe extern "C" fn __sanitizer_cov_trace_pc_guard_init(mut start: *mut u32
while start < stop {
MAX_EDGES_NUM = MAX_EDGES_NUM.wrapping_add(1);
if MAX_EDGES_NUM >= EDGES_MAP.len() {
panic!(format!("The number of edges reported by SanitizerCoverage exceed the size of the edges map ({}). Use the LIBAFL_EDGES_MAP_SIZE env to increase it at compile time.", EDGES_MAP.len()));
panic!("The number of edges reported by SanitizerCoverage exceed the size of the edges map ({}). Use the LIBAFL_EDGES_MAP_SIZE env to increase it at compile time.", EDGES_MAP.len());
}
*start = MAX_EDGES_NUM as u32;
start = start.offset(1);