1
Fork 0

Support CopyForDeref.

This commit is contained in:
Camille GILLOT 2023-09-07 17:13:58 +00:00
parent 82f0468009
commit b851e554dd
2 changed files with 14 additions and 4 deletions

View file

@ -119,6 +119,12 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'_, 'tcx> {
self.assign_operand(state, target, operand);
}
}
Rvalue::CopyForDeref(rhs) => {
state.flood(target.as_ref(), self.map());
if let Some(target) = self.map.find(target.as_ref()) {
self.assign_operand(state, target, &Operand::Copy(*rhs));
}
}
Rvalue::Aggregate(kind, operands) => {
// If we assign `target = Enum::Variant#0(operand)`,
// we must make sure that all `target as Variant#i` are `Top`.