MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / handle_path_join

Method handle_path_join

src/analysis/dfa.rs:470–499  ·  view source on GitHub ↗
(
        &mut self,
        block: &CFGBlock,
        store_mgr: &mut StoreMgr<T>,
        merge: &F,
    )

Source from the content-addressed store, hash-verified

468 }
469
470 fn handle_path_join<T: SymbolData, F: Fn(Vec<Symbol<T>>) -> Symbol<T>>(
471 &mut self,
472 block: &CFGBlock,
473 store_mgr: &mut StoreMgr<T>,
474 merge: &F,
475 ) -> Result<()> {
476 if block.is_entry() {
477 return Ok(());
478 }
479 let predecessors = self.cfg.get_predecessors(block);
480 let should_join = predecessors.len() > 1;
481 if should_join {
482 let mut path_vec = vec![];
483 for predecessor in predecessors {
484 let path_id = self.cfg.get_edge_weight(&predecessor, block).unwrap();
485 path_vec.push(*path_id);
486 }
487 log::trace!(
488 "block: {} meet path join with: {path_vec:?}.",
489 block.get_ident()
490 );
491 store_mgr.path_join(path_vec, merge)?;
492 } else {
493 let only_predecessor = &predecessors[0];
494 let path_id = self.cfg.get_edge_weight(only_predecessor, block).unwrap();
495 store_mgr.swith_to_path(*path_id);
496 log::trace!("block: {} set path to {path_id}.", block.get_ident());
497 }
498 Ok(())
499 }
500}
501
502#[derive(Default)]

Callers 1

handle_block_inMethod · 0.80

Calls 6

is_entryMethod · 0.80
get_predecessorsMethod · 0.80
get_edge_weightMethod · 0.80
path_joinMethod · 0.80
swith_to_pathMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected