@@ -49,6 +49,75 @@ pub const SIGRTMAX: i32 = 42;
49
49
/// base address for each evaluation would produce unbounded memory usage.
50
50
const ADDRS_PER_ANON_GLOBAL : usize = 32 ;
51
51
52
+ #[ derive( Copy , Clone , Debug , PartialEq ) ]
53
+ pub enum AlignmentCheck {
54
+ /// Do not check alignment.
55
+ None ,
56
+ /// Check alignment "symbolically", i.e., using only the requested alignment for an allocation and not its real base address.
57
+ Symbolic ,
58
+ /// Check alignment on the actual physical integer address.
59
+ Int ,
60
+ }
61
+
62
+ #[ derive( Copy , Clone , Debug , PartialEq ) ]
63
+ pub enum RejectOpWith {
64
+ /// Isolated op is rejected with an abort of the machine.
65
+ Abort ,
66
+
67
+ /// If not Abort, miri returns an error for an isolated op.
68
+ /// Following options determine if user should be warned about such error.
69
+ /// Do not print warning about rejected isolated op.
70
+ NoWarning ,
71
+
72
+ /// Print a warning about rejected isolated op, with backtrace.
73
+ Warning ,
74
+
75
+ /// Print a warning about rejected isolated op, without backtrace.
76
+ WarningWithoutBacktrace ,
77
+ }
78
+
79
+ #[ derive( Copy , Clone , Debug , PartialEq ) ]
80
+ pub enum IsolatedOp {
81
+ /// Reject an op requiring communication with the host. By
82
+ /// default, miri rejects the op with an abort. If not, it returns
83
+ /// an error code, and prints a warning about it. Warning levels
84
+ /// are controlled by `RejectOpWith` enum.
85
+ Reject ( RejectOpWith ) ,
86
+
87
+ /// Execute op requiring communication with the host, i.e. disable isolation.
88
+ Allow ,
89
+ }
90
+
91
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
92
+ pub enum BacktraceStyle {
93
+ /// Prints a terser backtrace which ideally only contains relevant information.
94
+ Short ,
95
+ /// Prints a backtrace with all possible information.
96
+ Full ,
97
+ /// Prints only the frame that the error occurs in.
98
+ Off ,
99
+ }
100
+
101
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
102
+ pub enum ValidationMode {
103
+ /// Do not perform any kind of validation.
104
+ No ,
105
+ /// Validate the interior of the value, but not things behind references.
106
+ Shallow ,
107
+ /// Fully recursively validate references.
108
+ Deep ,
109
+ }
110
+
111
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
112
+ pub enum FloatRoundingErrorMode {
113
+ /// Apply a random error (the default).
114
+ Random ,
115
+ /// Don't apply any error.
116
+ None ,
117
+ /// Always apply the maximum error (with a random sign).
118
+ Max ,
119
+ }
120
+
52
121
/// Extra data stored with each stack frame
53
122
pub struct FrameExtra < ' tcx > {
54
123
/// Extra data for the Borrow Tracker.
@@ -599,7 +668,7 @@ pub struct MiriMachine<'tcx> {
599
668
/// Whether floating-point operations can behave non-deterministically.
600
669
pub float_nondet : bool ,
601
670
/// Whether floating-point operations can have a non-deterministic rounding error.
602
- pub float_rounding_error : bool ,
671
+ pub float_rounding_error : FloatRoundingErrorMode ,
603
672
}
604
673
605
674
impl < ' tcx > MiriMachine < ' tcx > {
0 commit comments