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

Method visit_binary_operator

src/analysis/dfa.rs:203–219  ·  view source on GitHub ↗
(&mut self, stmt: &ast::Node)

Source from the content-addressed store, hash-verified

201 }
202
203 fn visit_binary_operator(&mut self, stmt: &ast::Node) -> Result<()> {
204 if let ast::Clang::BinaryOperator(bo) = &stmt.kind {
205 let left = bo.get_lhs(stmt);
206 let right = bo.get_rhs(stmt);
207 if bo.is_assignment() {
208 let var = left.get_var_name();
209 let sym = self.get_rvalue(right)?;
210 self.store_mgr.ssa_bind_value(var, sym)?;
211 } else {
212 self.visit_stmt(left)?;
213 self.visit_stmt(right)?;
214 }
215 // do not evalute other kinds of binary operator.
216 return Ok(());
217 }
218 eyre::bail!("Visit BinaryOperator, but visited {stmt:?}")
219 }
220
221 fn visit_call_expr(&mut self, stmt: &ast::Node) -> Result<()> {
222 // TODO: here to add callback

Callers 1

visit_stmtMethod · 0.80

Calls 7

get_lhsMethod · 0.80
get_rhsMethod · 0.80
is_assignmentMethod · 0.80
get_var_nameMethod · 0.80
get_rvalueMethod · 0.80
ssa_bind_valueMethod · 0.80
visit_stmtMethod · 0.80

Tested by

no test coverage detected