@@ -247,6 +247,7 @@ pub enum InterpError<'tcx, O> {
247
247
DanglingPointerDeref,
248
248
DoubleFree,
249
249
InvalidMemoryAccess,
250
+ FunctionPointerTyMismatch(FnSig<'tcx>, FnSig<'tcx>),
250
251
InvalidFunctionPointer,
251
252
InvalidBool,
252
253
InvalidDiscriminant(ScalarMaybeUndef),
@@ -266,11 +267,13 @@ pub enum InterpError<'tcx, O> {
266
267
Unimplemented(String),
267
268
DerefFunctionPointer,
268
269
ExecuteMemory,
270
+ // asd
269
271
BoundsCheck { len: O, index: O },
270
272
Overflow(mir::BinOp),
271
273
OverflowNeg,
272
274
DivisionByZero,
273
275
RemainderByZero,
276
+ // asd
274
277
Intrinsic(String),
275
278
InvalidChar(u128),
276
279
StackFrameLimitReached,
@@ -281,6 +284,29 @@ pub enum InterpError<'tcx, O> {
281
284
required: Align,
282
285
has: Align,
283
286
},
287
+ MemoryLockViolation {
288
+ ptr: Pointer,
289
+ len: u64,
290
+ frame: usize,
291
+ access: AccessKind,
292
+ lock: Lock,
293
+ },
294
+ MemoryAcquireConflict {
295
+ ptr: Pointer,
296
+ len: u64,
297
+ kind: AccessKind,
298
+ lock: Lock,
299
+ },
300
+ InvalidMemoryLockRelease {
301
+ ptr: Pointer,
302
+ len: u64,
303
+ frame: usize,
304
+ lock: Lock,
305
+ },
306
+ DeallocatedLockedMemory {
307
+ ptr: Pointer,
308
+ lock: Lock,
309
+ },
284
310
ValidationFailure(String),
285
311
CalledClosureAsFunction,
286
312
VtableForArgumentlessMethod,
@@ -298,12 +324,7 @@ pub enum InterpError<'tcx, O> {
298
324
HeapAllocZeroBytes,
299
325
HeapAllocNonPowerOfTwoAlignment(u64),
300
326
Unreachable,
301
- Panic {
302
- msg: Symbol,
303
- line: u32,
304
- col: u32,
305
- file: Symbol,
306
- },
327
+ Panic(EvalErrorPanic<'tcx, O>),
307
328
ReadFromReturnPointer,
308
329
PathNotFound(Vec<String>),
309
330
UnimplementedTraitSelection,
@@ -319,6 +340,16 @@ pub enum InterpError<'tcx, O> {
319
340
InfiniteLoop,
320
341
}
321
342
343
+ #[derive(Clone, RustcEncodable, RustcDecodable)]
344
+ pub enum EvalErrorPanic<'tcx, O> {
345
+ Panic,
346
+ BoundsCheck { len: O, index: O },
347
+ Overflow(mir::BinOp),
348
+ OverflowNeg,
349
+ DivisionByZero,
350
+ RemainderByZero,
351
+ }
352
+
322
353
pub type InterpResult<'tcx, T = ()> = Result<T, InterpErrorInfo<'tcx>>;
323
354
324
355
impl<'tcx, O> InterpError<'tcx, O> {
0 commit comments