@@ -255,13 +255,19 @@ pub struct Evaluator<'mir, 'tcx> {
255255 /// Whether to enforce the validity invariant.
256256 pub ( crate ) validate : bool ,
257257
258- /// Whether to enforce validity (e.g., initialization) of integers and floats.
259- pub ( crate ) enforce_number_validity : bool ,
258+ /// Whether to allow uninitialized numbers (integers and floats).
259+ pub ( crate ) allow_uninit_numbers : bool ,
260+
261+ /// Whether to allow ptr2int transmutes, and whether to allow *dereferencing* the result of an
262+ /// int2ptr transmute.
263+ pub ( crate ) allow_ptr_int_transmute : bool ,
260264
261265 /// Whether to enforce [ABI](Abi) of function calls.
262266 pub ( crate ) enforce_abi : bool ,
263267
268+ /// The table of file descriptors.
264269 pub ( crate ) file_handler : shims:: posix:: FileHandler ,
270+ /// The table of directory descriptors.
265271 pub ( crate ) dir_handler : shims:: posix:: DirHandler ,
266272
267273 /// The "time anchor" for this machine's monotone clock (for `Instant` simulation).
@@ -351,7 +357,8 @@ impl<'mir, 'tcx> Evaluator<'mir, 'tcx> {
351357 tls : TlsData :: default ( ) ,
352358 isolated_op : config. isolated_op ,
353359 validate : config. validate ,
354- enforce_number_validity : config. check_number_validity ,
360+ allow_uninit_numbers : config. allow_uninit_numbers ,
361+ allow_ptr_int_transmute : config. allow_ptr_int_transmute ,
355362 enforce_abi : config. check_abi ,
356363 file_handler : FileHandler :: new ( config. mute_stdout_stderr ) ,
357364 dir_handler : Default :: default ( ) ,
@@ -493,12 +500,12 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
493500
494501 #[ inline( always) ]
495502 fn enforce_number_init ( ecx : & MiriEvalContext < ' mir , ' tcx > ) -> bool {
496- ecx. machine . enforce_number_validity
503+ ! ecx. machine . allow_uninit_numbers
497504 }
498505
499506 #[ inline( always) ]
500507 fn enforce_number_no_provenance ( ecx : & MiriEvalContext < ' mir , ' tcx > ) -> bool {
501- ecx. machine . enforce_number_validity
508+ ! ecx. machine . allow_ptr_int_transmute
502509 }
503510
504511 #[ inline( always) ]
0 commit comments