Skip to content

Commit

Permalink
hot fix for rcanary due to place changed
Browse files Browse the repository at this point in the history
  • Loading branch information
VaynNecol committed Dec 17, 2024
1 parent fa8854f commit fb6ca20
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
24 changes: 24 additions & 0 deletions rap/src/analysis/rcanary/ranalyzer/intra_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,30 @@ impl<'tcx, 'ctx, 'a> IntraFlowAnalysis<'tcx, 'ctx, 'a> {
}
}
}
Rvalue::RawPtr(_, ref rplace) => {
let kind = AsgnKind::Reference;
let rvalue_has_projection = has_projection(rplace);
match (lvalue_has_projection, rvalue_has_projection) {
(true, true) => {
self.handle_copy_field_to_field(
ctx, goal, solver, kind, lplace, rplace, disc, bidx, sidx,
);
}
(true, false) => {
self.handle_copy_to_field(
ctx, goal, solver, kind, lplace, rplace, disc, bidx, sidx,
);
}
(false, true) => {
self.handle_copy_from_field(
ctx, goal, solver, kind, lplace, rplace, bidx, sidx,
);
}
(false, false) => {
self.handle_copy(ctx, goal, solver, kind, lplace, rplace, bidx, sidx);
}
}
}
Rvalue::Cast(_cast_kind, op, ..) => {
let kind = AsgnKind::Cast;
match op {
Expand Down
3 changes: 1 addition & 2 deletions rap/src/analysis/safedrop/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,7 @@ impl<'tcx> SafeDropGraph<'tcx> {
}
}
}
Rvalue::Ref(_, _, ref p)
| Rvalue::RawPtr(_, ref p)=> {
Rvalue::Ref(_, _, ref p) | Rvalue::RawPtr(_, ref p) => {
let rv_local = p.local.as_usize();
if values[lv_local].may_drop && values[rv_local].may_drop {
let rv = p.clone();
Expand Down

0 comments on commit fb6ca20

Please sign in to comment.