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

Method gen_signature

src/program/gadget.rs:556–575  ·  view source on GitHub ↗

get the function signature.

(&self)

Source from the content-addressed store, hash-verified

554
555 /// get the function signature.
556 pub fn gen_signature(&self) -> String {
557 let ret_type = &self.alias_ret_type;
558 let name = &self.name;
559 let mut args = String::new();
560 for (index, ty) in self.alias_arg_types.iter().enumerate() {
561 let ident = &self.arg_idents[index];
562 let (ty, size) = split_ty_with_size(ty);
563 let arg = if let Some(size) = size {
564 format!("{ty} {ident}{size}")
565 } else {
566 format!("{ty} {ident}")
567 };
568 args.push_str(&arg);
569 if index != self.alias_arg_types.len() - 1 {
570 args.push_str(", ");
571 }
572 }
573 let sig = format!("{ret_type}{name}({args})");
574 sig
575 }
576
577 pub fn get_alias_arg_types(&self) -> &Vec<String> {
578 &self.alias_arg_types

Callers 3

combination_to_strFunction · 0.80
dump_func_gadgetsFunction · 0.80
dump_func_gadgets_tostrFunction · 0.80

Calls 1

split_ty_with_sizeFunction · 0.85

Tested by

no test coverage detected