MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / get_blocks

Method get_blocks

hail-fuzz/src/coverage.rs:392–408  ·  view source on GitHub ↗
(&self, vm: &mut Vm)

Source from the content-addressed store, hash-verified

390 }
391
392 pub fn get_blocks(&self, vm: &mut Vm) -> Vec<u64> {
393 self.update_mapping_cache(vm);
394 let mapping = self.mapping_cache.borrow();
395 let bitmap: &[u64] = bytemuck::cast_slice(vm.cpu.trace[self.storage].data());
396
397 if self.pack_bits {
398 bit_iter(bitmap).map(|x| mapping.get(x).map_or(0, |(addr, _)| *addr)).collect()
399 }
400 else {
401 bitmap
402 .iter()
403 .enumerate()
404 .filter(|(_, entry)| **entry != 0)
405 .map(|(i, _)| mapping.get(i).map_or(0, |(addr, _)| *addr))
406 .collect()
407 }
408 }
409
410 /// Returns the blocks corresponding to the bits indexed by `target` that are not set.
411 pub fn get_unreached_blocks(&self, vm: &mut Vm, target: &[u32]) -> Vec<u64> {

Callers 1

save_block_coverageFunction · 0.80

Calls 3

bit_iterFunction · 0.85
update_mapping_cacheMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected