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

Method visit_library_calls

src/ast/visitor.rs:174–189  ·  view source on GitHub ↗

visit all the callexpr that are library calls.

(&self)

Source from the content-addressed store, hash-verified

172
173 /// visit all the callexpr that are library calls.
174 pub fn visit_library_calls(&self) -> Vec<&Node> {
175 let mut calls = Vec::new();
176 let mut worklist = WorkList::new();
177 worklist.push(&self.ast);
178 while !worklist.empty() {
179 let curr = worklist.pop();
180 if let Clang::CallExpr(ce) = &curr.kind {
181 let name = ce.get_name_as_string(curr);
182 if get_func_gadget(&name).is_some() {
183 calls.push(curr);
184 }
185 }
186 worklist.push_childs(curr.get_childs());
187 }
188 calls
189 }
190
191 pub fn get_library_call_names(&self) -> Vec<String> {
192 let mut calls = Vec::new();

Callers 4

infer_constraintsFunction · 0.80

Calls 7

get_func_gadgetFunction · 0.85
emptyMethod · 0.80
popMethod · 0.80
get_name_as_stringMethod · 0.80
push_childsMethod · 0.80
pushMethod · 0.45
get_childsMethod · 0.45

Tested by

no test coverage detected