1
1
//! The virtual memory representation of the MIR interpreter.
2
2
3
3
use super :: {
4
- Pointer , EvalResult , AllocId , ScalarMaybeUndef , write_target_uint, read_target_uint, Scalar ,
4
+ Pointer , InterpResult , AllocId , ScalarMaybeUndef , write_target_uint, read_target_uint, Scalar ,
5
5
truncate,
6
6
} ;
7
7
@@ -62,7 +62,7 @@ pub trait AllocationExtra<Tag, MemoryExtra>: ::std::fmt::Debug + Clone {
62
62
_alloc : & Allocation < Tag , Self > ,
63
63
_ptr : Pointer < Tag > ,
64
64
_size : Size ,
65
- ) -> EvalResult < ' tcx > {
65
+ ) -> InterpResult < ' tcx > {
66
66
Ok ( ( ) )
67
67
}
68
68
@@ -72,7 +72,7 @@ pub trait AllocationExtra<Tag, MemoryExtra>: ::std::fmt::Debug + Clone {
72
72
_alloc : & mut Allocation < Tag , Self > ,
73
73
_ptr : Pointer < Tag > ,
74
74
_size : Size ,
75
- ) -> EvalResult < ' tcx > {
75
+ ) -> InterpResult < ' tcx > {
76
76
Ok ( ( ) )
77
77
}
78
78
@@ -83,7 +83,7 @@ pub trait AllocationExtra<Tag, MemoryExtra>: ::std::fmt::Debug + Clone {
83
83
_alloc : & mut Allocation < Tag , Self > ,
84
84
_ptr : Pointer < Tag > ,
85
85
_size : Size ,
86
- ) -> EvalResult < ' tcx > {
86
+ ) -> InterpResult < ' tcx > {
87
87
Ok ( ( ) )
88
88
}
89
89
}
@@ -140,7 +140,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
140
140
fn check_bounds_ptr (
141
141
& self ,
142
142
ptr : Pointer < Tag > ,
143
- ) -> EvalResult < ' tcx > {
143
+ ) -> InterpResult < ' tcx > {
144
144
let allocation_size = self . bytes . len ( ) as u64 ;
145
145
ptr. check_in_alloc ( Size :: from_bytes ( allocation_size) , InboundsCheck :: Live )
146
146
}
@@ -152,7 +152,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
152
152
cx : & impl HasDataLayout ,
153
153
ptr : Pointer < Tag > ,
154
154
size : Size ,
155
- ) -> EvalResult < ' tcx > {
155
+ ) -> InterpResult < ' tcx > {
156
156
// if ptr.offset is in bounds, then so is ptr (because offset checks for overflow)
157
157
self . check_bounds_ptr ( ptr. offset ( size, cx) ?)
158
158
}
@@ -173,7 +173,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
173
173
ptr : Pointer < Tag > ,
174
174
size : Size ,
175
175
check_defined_and_ptr : bool ,
176
- ) -> EvalResult < ' tcx , & [ u8 ] >
176
+ ) -> InterpResult < ' tcx , & [ u8 ] >
177
177
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
178
178
where Extra : AllocationExtra < Tag , MemoryExtra >
179
179
{
@@ -201,7 +201,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
201
201
cx : & impl HasDataLayout ,
202
202
ptr : Pointer < Tag > ,
203
203
size : Size ,
204
- ) -> EvalResult < ' tcx , & [ u8 ] >
204
+ ) -> InterpResult < ' tcx , & [ u8 ] >
205
205
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
206
206
where Extra : AllocationExtra < Tag , MemoryExtra >
207
207
{
@@ -216,7 +216,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
216
216
cx : & impl HasDataLayout ,
217
217
ptr : Pointer < Tag > ,
218
218
size : Size ,
219
- ) -> EvalResult < ' tcx , & [ u8 ] >
219
+ ) -> InterpResult < ' tcx , & [ u8 ] >
220
220
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
221
221
where Extra : AllocationExtra < Tag , MemoryExtra >
222
222
{
@@ -230,7 +230,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
230
230
cx : & impl HasDataLayout ,
231
231
ptr : Pointer < Tag > ,
232
232
size : Size ,
233
- ) -> EvalResult < ' tcx , & mut [ u8 ] >
233
+ ) -> InterpResult < ' tcx , & mut [ u8 ] >
234
234
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
235
235
where Extra : AllocationExtra < Tag , MemoryExtra >
236
236
{
@@ -257,7 +257,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
257
257
& self ,
258
258
cx : & impl HasDataLayout ,
259
259
ptr : Pointer < Tag > ,
260
- ) -> EvalResult < ' tcx , & [ u8 ] >
260
+ ) -> InterpResult < ' tcx , & [ u8 ] >
261
261
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
262
262
where Extra : AllocationExtra < Tag , MemoryExtra >
263
263
{
@@ -284,7 +284,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
284
284
ptr : Pointer < Tag > ,
285
285
size : Size ,
286
286
allow_ptr_and_undef : bool ,
287
- ) -> EvalResult < ' tcx >
287
+ ) -> InterpResult < ' tcx >
288
288
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
289
289
where Extra : AllocationExtra < Tag , MemoryExtra >
290
290
{
@@ -306,7 +306,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
306
306
cx : & impl HasDataLayout ,
307
307
ptr : Pointer < Tag > ,
308
308
src : & [ u8 ] ,
309
- ) -> EvalResult < ' tcx >
309
+ ) -> InterpResult < ' tcx >
310
310
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
311
311
where Extra : AllocationExtra < Tag , MemoryExtra >
312
312
{
@@ -322,7 +322,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
322
322
ptr : Pointer < Tag > ,
323
323
val : u8 ,
324
324
count : Size
325
- ) -> EvalResult < ' tcx >
325
+ ) -> InterpResult < ' tcx >
326
326
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
327
327
where Extra : AllocationExtra < Tag , MemoryExtra >
328
328
{
@@ -346,7 +346,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
346
346
cx : & impl HasDataLayout ,
347
347
ptr : Pointer < Tag > ,
348
348
size : Size
349
- ) -> EvalResult < ' tcx , ScalarMaybeUndef < Tag > >
349
+ ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > >
350
350
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
351
351
where Extra : AllocationExtra < Tag , MemoryExtra >
352
352
{
@@ -383,7 +383,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
383
383
& self ,
384
384
cx : & impl HasDataLayout ,
385
385
ptr : Pointer < Tag > ,
386
- ) -> EvalResult < ' tcx , ScalarMaybeUndef < Tag > >
386
+ ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > >
387
387
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
388
388
where Extra : AllocationExtra < Tag , MemoryExtra >
389
389
{
@@ -404,7 +404,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
404
404
ptr : Pointer < Tag > ,
405
405
val : ScalarMaybeUndef < Tag > ,
406
406
type_size : Size ,
407
- ) -> EvalResult < ' tcx >
407
+ ) -> InterpResult < ' tcx >
408
408
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
409
409
where Extra : AllocationExtra < Tag , MemoryExtra >
410
410
{
@@ -451,7 +451,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
451
451
cx : & impl HasDataLayout ,
452
452
ptr : Pointer < Tag > ,
453
453
val : ScalarMaybeUndef < Tag >
454
- ) -> EvalResult < ' tcx >
454
+ ) -> InterpResult < ' tcx >
455
455
// FIXME: Working around https://github.com/rust-lang/rust/issues/56209
456
456
where Extra : AllocationExtra < Tag , MemoryExtra >
457
457
{
@@ -483,7 +483,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
483
483
cx : & impl HasDataLayout ,
484
484
ptr : Pointer < Tag > ,
485
485
size : Size ,
486
- ) -> EvalResult < ' tcx > {
486
+ ) -> InterpResult < ' tcx > {
487
487
if self . relocations ( cx, ptr, size) . is_empty ( ) {
488
488
Ok ( ( ) )
489
489
} else {
@@ -502,7 +502,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
502
502
cx : & impl HasDataLayout ,
503
503
ptr : Pointer < Tag > ,
504
504
size : Size ,
505
- ) -> EvalResult < ' tcx > {
505
+ ) -> InterpResult < ' tcx > {
506
506
// Find the start and end of the given range and its outermost relocations.
507
507
let ( first, last) = {
508
508
// Find all relocations overlapping the given range.
@@ -540,7 +540,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
540
540
cx : & impl HasDataLayout ,
541
541
ptr : Pointer < Tag > ,
542
542
size : Size ,
543
- ) -> EvalResult < ' tcx > {
543
+ ) -> InterpResult < ' tcx > {
544
544
self . check_relocations ( cx, ptr, Size :: ZERO ) ?;
545
545
self . check_relocations ( cx, ptr. offset ( size, cx) ?, Size :: ZERO ) ?;
546
546
Ok ( ( ) )
@@ -553,7 +553,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
553
553
/// Checks that a range of bytes is defined. If not, returns the `ReadUndefBytes`
554
554
/// error which will report the first byte which is undefined.
555
555
#[ inline]
556
- fn check_defined ( & self , ptr : Pointer < Tag > , size : Size ) -> EvalResult < ' tcx > {
556
+ fn check_defined ( & self , ptr : Pointer < Tag > , size : Size ) -> InterpResult < ' tcx > {
557
557
self . undef_mask . is_range_defined (
558
558
ptr. offset ,
559
559
ptr. offset + size,
@@ -565,7 +565,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
565
565
ptr : Pointer < Tag > ,
566
566
size : Size ,
567
567
new_state : bool ,
568
- ) -> EvalResult < ' tcx > {
568
+ ) -> InterpResult < ' tcx > {
569
569
if size. bytes ( ) == 0 {
570
570
return Ok ( ( ) ) ;
571
571
}
0 commit comments