1
Fork 0

add new rval, pull deref early

This commit is contained in:
ouz-a 2022-06-13 16:37:41 +03:00
parent b3f4c31199
commit cb0017f2f8
41 changed files with 274 additions and 103 deletions

View file

@ -35,6 +35,7 @@ impl<'tcx> MutVisitor<'tcx> for DerefChecker<'tcx> {
last_deref_idx = idx;
}
}
for (idx, (p_ref, p_elem)) in place.iter_projections().enumerate() {
if !p_ref.projection.is_empty() && p_elem == ProjectionElem::Deref {
let ty = p_ref.ty(&self.local_decls, self.tcx).ty;
@ -54,7 +55,7 @@ impl<'tcx> MutVisitor<'tcx> for DerefChecker<'tcx> {
self.patcher.add_assign(
loc,
Place::from(temp),
Rvalue::Use(Operand::Move(deref_place)),
Rvalue::CopyForDeref(deref_place),
);
place_local = temp;
last_len = p_ref.projection.len();