File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
compiler/rustc_mir_dataflow/src Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,13 @@ pub trait ValueAnalysis<'tcx> {
91
91
self . handle_intrinsic ( intrinsic, state) ;
92
92
}
93
93
StatementKind :: StorageLive ( local) | StatementKind :: StorageDead ( local) => {
94
- // It is UB to read from an unitialized or unallocated local.
95
- state. flood ( Place :: from ( * local) . as_ref ( ) , self . map ( ) ) ;
94
+ // We can flood with bottom here, because `StorageLive` makes the local
95
+ // uninitialized, and `StorageDead` makes it UB to access.
96
+ state. flood_with ( Place :: from ( * local) . as_ref ( ) , self . map ( ) , Self :: Value :: bottom ( ) ) ;
96
97
}
97
98
StatementKind :: Deinit ( box place) => {
98
- // It is UB to read `uninit` bytes .
99
- state. flood ( place. as_ref ( ) , self . map ( ) ) ;
99
+ // The bottom states denotes uninitialized values .
100
+ state. flood_with ( place. as_ref ( ) , self . map ( ) , Self :: Value :: bottom ( ) ) ;
100
101
}
101
102
StatementKind :: Nop
102
103
| StatementKind :: Retag ( ..)
You can’t perform that action at this time.
0 commit comments