mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-11 17:51:33 +00:00
Apply allowlist to all blocks within a function (#2785)
This commit is contained in:
@ -124,16 +124,27 @@ pub fn find_coverage_sites(
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(location) = symcache.lookup(function.offset.0).next() {
|
||||
if let Some(file) = location.file() {
|
||||
let path = file.full_path();
|
||||
let blocks = block::sweep_region(module, &debuginfo, function.offset, function.size)?;
|
||||
|
||||
if allowlist.source_files.is_allowed(path) {
|
||||
let blocks =
|
||||
block::sweep_region(module, &debuginfo, function.offset, function.size)?;
|
||||
offsets.extend(blocks.iter().map(|b| b.offset));
|
||||
for block in &blocks {
|
||||
if let Some(location) = symcache.lookup(block.offset.0).next() {
|
||||
if let Some(file) = location.file() {
|
||||
let path = file.full_path();
|
||||
|
||||
// Apply allowlists per block, to account for inlining. The `location` values
|
||||
// here describe the top of the inline-inclusive call stack.
|
||||
if !allowlist.functions.is_allowed(&path) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if !allowlist.source_files.is_allowed(&path) {
|
||||
continue;
|
||||
}
|
||||
|
||||
offsets.insert(block.offset);
|
||||
}
|
||||
}
|
||||
println!();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user