Skip to content

Commit

Permalink
fix: enable checking of raw ptr escaping to return values or params (B…
Browse files Browse the repository at this point in the history
  • Loading branch information
BurtonQin committed Sep 1, 2024
1 parent 2318e67 commit 774ee22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/analysis/pointsto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ConstraintGraphCollector<'a, 'tcx> {
.as_slice(),
destination,
) {
(&[Operand::Move(arg)], dest) => {
(&[Operand::Move(arg)], dest) | (&[Operand::Copy(arg)], dest) => {
let func_ty = func.ty(self.body, self.tcx);
if let TyKind::FnDef(def_id, substs) = func_ty.kind() {
if ownership::is_arc_or_rc_clone(*def_id, substs, self.tcx)
Expand All @@ -617,7 +617,8 @@ impl<'a, 'tcx> Visitor<'tcx> for ConstraintGraphCollector<'a, 'tcx> {
}
}
}
(&[Operand::Move(arg0), Operand::Move(arg1), Operand::Move(_arg2)], _dest) => {
(&[Operand::Move(arg0), Operand::Move(arg1), Operand::Move(_arg2)], _dest)
| (&[Operand::Move(arg0), Operand::Move(arg1), Operand::Copy(_arg2)], _dest) => {
let func_ty = func.ty(self.body, self.tcx);
if let TyKind::FnDef(def_id, list) = func_ty.kind() {
if is_atomic_ptr_store(*def_id, list, self.tcx) {
Expand Down

0 comments on commit 774ee22

Please sign in to comment.