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

Method inject

hail-fuzz/src/load_resizer.rs:486–513  ·  view source on GitHub ↗
(&mut self, cpu: &mut Cpu, group: &BlockGroup, code: &mut BlockTable)

Source from the content-addressed store, hash-verified

484
485impl icicle_vm::CodeInjector for LoadResizeInjector {
486 fn inject(&mut self, cpu: &mut Cpu, group: &BlockGroup, code: &mut BlockTable) {
487 for block in group.blocks.0..group.blocks.1 {
488 if !self.optimize_upper_bits {
489 // Directly resize the underlying load pcode ops.
490 if let Err(e) = self.resizer.resize_loads(cpu, code, block) {
491 tracing::warn!("[{:#x}] failed to resize load ops: {e}", group.start);
492 }
493 }
494 else {
495 // Apply resize operations as models.
496 match self.resizer.get_loads(cpu, code, block) {
497 Ok(metadata) => {
498 let mem = cpu
499 .mem
500 .get_io_memory_mut(self.mmio_ref)
501 .as_mut_any()
502 .downcast_mut::<crate::input::MultiStreamMmio>()
503 .unwrap();
504
505 for (pc, load) in metadata {
506 mem.add_extract_model(pc, load.min_bit, load.max_bit)
507 }
508 }
509 Err(e) => tracing::warn!("[{:#x}] failed to resize load ops: {e}", group.start),
510 }
511 }
512 }
513 }
514}
515
516#[derive(Debug, Copy, Clone, PartialEq, Eq)]

Callers

nothing calls this directly

Calls 4

resize_loadsMethod · 0.80
get_loadsMethod · 0.80
as_mut_anyMethod · 0.80
add_extract_modelMethod · 0.80

Tested by

no test coverage detected