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

Method get_var_init

src/ast/kind.rs:226–238  ·  view source on GitHub ↗
(&self, visitor: &'a Visitor)

Source from the content-addressed store, hash-verified

224 }
225
226 pub fn get_var_init<'a>(&self, visitor: &'a Visitor) -> Option<&'a Node> {
227 let var_name = self.get_name_as_string();
228 if let Some(var) = visitor.find_vardecl(&var_name) {
229 if let Clang::VarDecl(vd) = &var.kind {
230 if !vd.has_init(var) {
231 return None;
232 }
233 let init = vd.get_init(var).ignore_parent().ignore_cast();
234 return Some(init);
235 }
236 }
237 None
238 }
239
240 // if this variable is initialized by a call, return this call.
241 pub fn get_var_init_call<'a>(&self, visitor: &'a Visitor) -> Option<&'a Node> {

Callers 14

get_var_init_callMethod · 0.80
is_arg_fuzzableFunction · 0.80
is_ret_by_callFunction · 0.80
is_file_nameFunction · 0.80
is_file_descriptorFunction · 0.80
is_null_ptrFunction · 0.80
is_macro_literalFunction · 0.80
is_data_and_sizeFunction · 0.80
is_sizeof_expr_of_varFunction · 0.80
is_size_of_varFunction · 0.80

Calls 6

get_name_as_stringMethod · 0.80
find_vardeclMethod · 0.80
has_initMethod · 0.80
ignore_castMethod · 0.80
ignore_parentMethod · 0.80
get_initMethod · 0.80

Tested by

no test coverage detected