@@ -90,14 +90,14 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
90
90
// Make space for `0` terminator.
91
91
let size = arg. len ( ) as u64 + 1 ;
92
92
let arg_type = tcx. mk_array ( tcx. types . u8 , size) ;
93
- let arg_place = ecx. allocate ( ecx. layout_of ( arg_type) ?, MiriMemoryKind :: Env . into ( ) ) ;
93
+ let arg_place = ecx. allocate ( ecx. layout_of ( arg_type) ?, MiriMemoryKind :: Machine . into ( ) ) ;
94
94
ecx. write_os_str_to_c_str ( OsStr :: new ( arg) , arg_place. ptr , size) ?;
95
95
argvs. push ( arg_place. ptr ) ;
96
96
}
97
97
// Make an array with all these pointers, in the Miri memory.
98
98
let argvs_layout =
99
99
ecx. layout_of ( tcx. mk_array ( tcx. mk_imm_ptr ( tcx. types . u8 ) , argvs. len ( ) as u64 ) ) ?;
100
- let argvs_place = ecx. allocate ( argvs_layout, MiriMemoryKind :: Env . into ( ) ) ;
100
+ let argvs_place = ecx. allocate ( argvs_layout, MiriMemoryKind :: Machine . into ( ) ) ;
101
101
for ( idx, arg) in argvs. into_iter ( ) . enumerate ( ) {
102
102
let place = ecx. mplace_field ( argvs_place, idx as u64 ) ?;
103
103
ecx. write_scalar ( arg, place. into ( ) ) ?;
@@ -108,13 +108,13 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
108
108
// Store `argc` and `argv` for macOS `_NSGetArg{c,v}`.
109
109
{
110
110
let argc_place =
111
- ecx. allocate ( ecx. layout_of ( tcx. types . isize ) ?, MiriMemoryKind :: Env . into ( ) ) ;
111
+ ecx. allocate ( ecx. layout_of ( tcx. types . isize ) ?, MiriMemoryKind :: Machine . into ( ) ) ;
112
112
ecx. write_scalar ( argc, argc_place. into ( ) ) ?;
113
113
ecx. machine . argc = Some ( argc_place. ptr ) ;
114
114
115
115
let argv_place = ecx. allocate (
116
116
ecx. layout_of ( tcx. mk_imm_ptr ( tcx. types . unit ) ) ?,
117
- MiriMemoryKind :: Env . into ( ) ,
117
+ MiriMemoryKind :: Machine . into ( ) ,
118
118
) ;
119
119
ecx. write_scalar ( argv, argv_place. into ( ) ) ?;
120
120
ecx. machine . argv = Some ( argv_place. ptr ) ;
@@ -134,7 +134,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
134
134
135
135
let cmd_utf16: Vec < u16 > = cmd. encode_utf16 ( ) . collect ( ) ;
136
136
let cmd_type = tcx. mk_array ( tcx. types . u16 , cmd_utf16. len ( ) as u64 ) ;
137
- let cmd_place = ecx. allocate ( ecx. layout_of ( cmd_type) ?, MiriMemoryKind :: Env . into ( ) ) ;
137
+ let cmd_place = ecx. allocate ( ecx. layout_of ( cmd_type) ?, MiriMemoryKind :: Machine . into ( ) ) ;
138
138
ecx. machine . cmd_line = Some ( cmd_place. ptr ) ;
139
139
// Store the UTF-16 string. We just allocated so we know the bounds are fine.
140
140
let char_size = Size :: from_bytes ( 2 ) ;
@@ -147,7 +147,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
147
147
} ;
148
148
149
149
// Return place (in static memory so that it does not count as leak).
150
- let ret_place = ecx. allocate ( ecx. layout_of ( tcx. types . isize ) ?, MiriMemoryKind :: Env . into ( ) ) ;
150
+ let ret_place = ecx. allocate ( ecx. layout_of ( tcx. types . isize ) ?, MiriMemoryKind :: Machine . into ( ) ) ;
151
151
// Call start function.
152
152
ecx. call_function (
153
153
start_instance,
@@ -158,7 +158,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
158
158
159
159
// Set the last_error to 0
160
160
let errno_layout = ecx. layout_of ( tcx. types . u32 ) ?;
161
- let errno_place = ecx. allocate ( errno_layout, MiriMemoryKind :: Env . into ( ) ) ;
161
+ let errno_place = ecx. allocate ( errno_layout, MiriMemoryKind :: Machine . into ( ) ) ;
162
162
ecx. write_scalar ( Scalar :: from_u32 ( 0 ) , errno_place. into ( ) ) ?;
163
163
ecx. machine . last_error = Some ( errno_place) ;
164
164
0 commit comments