Check alias of p1 and p2 if they are from the same fn. if pts(p1) intersect pts(p2) != empty then they probably alias else unlikely
(
&mut self,
instance: &Instance<'tcx>,
node1: &ConstraintNode<'tcx>,
node2: &ConstraintNode<'tcx>,
)
| 864 | /// Check alias of p1 and p2 if they are from the same fn. |
| 865 | /// if pts(p1) intersect pts(p2) != empty then they probably alias else unlikely |
| 866 | fn intraproc_alias( |
| 867 | &mut self, |
| 868 | instance: &Instance<'tcx>, |
| 869 | node1: &ConstraintNode<'tcx>, |
| 870 | node2: &ConstraintNode<'tcx>, |
| 871 | ) -> Option<ApproximateAliasKind> { |
| 872 | let body = self.tcx.instance_mir(instance.def); |
| 873 | let points_to_map = self.get_or_insert_pts(instance.def_id(), body).clone(); |
| 874 | let pts1 = points_to_map.get(node1)?.clone(); |
| 875 | let pts2 = points_to_map.get(node2)?.clone(); |
| 876 | if pts1.intersection(&pts2).next().is_some() { |
| 877 | return Some(ApproximateAliasKind::Probably); |
| 878 | } |
| 879 | if point_to_same_projected_alias(&pts1, &pts2, &points_to_map, body, self.tcx) { |
| 880 | Some(ApproximateAliasKind::Possibly) |
| 881 | } else { |
| 882 | Some(ApproximateAliasKind::Unlikely) |
| 883 | } |
| 884 | } |
| 885 | |
| 886 | /// Check if `pointer` points-to `pointee` in the same function. |
| 887 | fn intraproc_points_to( |
no test coverage detected