mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Use StorageDead and Deinit to flood place
This commit is contained in:
parent
904adcac0f
commit
1e5ca57014
@ -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…
Reference in New Issue
Block a user