Use StorageDead and Deinit to flood place
This commit is contained in:
parent
904adcac0f
commit
1e5ca57014
1 changed files with 8 additions and 4 deletions
|
@ -87,12 +87,16 @@ pub trait ValueAnalysis<'tcx> {
|
|||
StatementKind::CopyNonOverlapping(..) => {
|
||||
// FIXME: What to do here?
|
||||
}
|
||||
StatementKind::StorageLive(..)
|
||||
| StatementKind::StorageDead(..)
|
||||
| StatementKind::Deinit(_) => {
|
||||
// Could perhaps use these.
|
||||
StatementKind::StorageDead(local) => {
|
||||
// It is UB to access an unallocated local.
|
||||
state.flood(Place::from(*local).as_ref(), self.map());
|
||||
}
|
||||
StatementKind::Deinit(box place) => {
|
||||
// It is UB to access `uninit` bytes.
|
||||
state.flood(place.as_ref(), self.map());
|
||||
}
|
||||
StatementKind::Nop
|
||||
| StatementKind::StorageLive(..)
|
||||
| StatementKind::Retag(..)
|
||||
| StatementKind::FakeRead(..)
|
||||
| StatementKind::Coverage(..)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue