MCPcopy Create free account
hub / github.com/CodeSentryAI/lockbud / point_to_same_constant

Function point_to_same_constant

src/analysis/pointsto/mod.rs:1071–1082  ·  view source on GitHub ↗

Check if p1 and p2 point to the same Constant. Return true if exists a1 in pts(p1) and a1 is Constant(c1) and exists a2 in pts(p2) and a2 is Constant(c2) and c1 = c2

(
    pts1: &FxHashSet<ConstraintNode<'tcx>>,
    pts2: &FxHashSet<ConstraintNode<'tcx>>,
)

Source from the content-addressed store, hash-verified

1069 pts1: &FxHashSet<ConstraintNode<'tcx>>,
1070 pts2: &FxHashSet<ConstraintNode<'tcx>>,
1071) -> bool {
1072 let mut constants1 = pts1
1073 .iter()
1074 .filter(|node| matches!(node, &ConstraintNode::ConstantDeref(_)));
1075 let mut constants2 = pts2
1076 .iter()
1077 .filter(|node| matches!(node, &ConstraintNode::ConstantDeref(_)));
1078 constants1.any(|c1| constants2.any(|c2| c2 == c1))
1079}
1080
1081/// Check if `local` is a parameter
1082#[inline]
1083fn is_parameter(local: Local, body: &Body<'_>) -> bool {
1084 body.args_iter().any(|arg| arg == local)
1085}

Callers 1

interproc_aliasMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected