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

Method init_from_ast

src/analysis/cfg.rs:535–541  ·  view source on GitHub ↗

init the function name for this cfg builder.

(&mut self, ast: &ast::Node)

Source from the content-addressed store, hash-verified

533impl CFGBuilder {
534 /// init the function name for this cfg builder.
535 pub fn init_from_ast(&mut self, ast: &ast::Node) -> Result<()> {
536 if let ast::Clang::FunctionDecl(fd) = &ast.kind {
537 self.name = Some(fd.get_name());
538 return Ok(());
539 }
540 eyre::bail!("expect FunctionDecl, receive: {ast:?}");
541 }
542
543 /// get a builder starts with block_id.
544 pub fn from_block_id(block_id: usize) -> Self {

Callers 1

build_cfgMethod · 0.80

Calls 1

get_nameMethod · 0.45

Tested by

no test coverage detected