fn eval_libc(&mut self, name: &str) -> InterpResult<'tcx, Scalar<Tag>> {
self.eval_context_mut()
.eval_path_scalar(&["libc", name])?
- .not_undef()
+ .check_init()
}
/// Helper function to get a `libc` constant as an `i32`.
fn eval_windows(&mut self, module: &str, name: &str) -> InterpResult<'tcx, Scalar<Tag>> {
self.eval_context_mut()
.eval_path_scalar(&["std", "sys", "windows", module, name])?
- .not_undef()
+ .check_init()
}
/// Helper function to get a `windows` constant as an `u64`.
/// Helper function to get the `TyAndLayout` of a `libc` type
fn libc_ty_layout(&mut self, name: &str) -> InterpResult<'tcx, TyAndLayout<'tcx>> {
let this = self.eval_context_mut();
- let ty = this.resolve_path(&["libc", name]).monomorphic_ty(*this.tcx);
+ let ty = this.resolve_path(&["libc", name]).ty(*this.tcx, ty::ParamEnv::reveal_all());
this.layout_of(ty)
}
/// Helper function to get the `TyAndLayout` of a `windows` type
fn windows_ty_layout(&mut self, name: &str) -> InterpResult<'tcx, TyAndLayout<'tcx>> {
let this = self.eval_context_mut();
- let ty = this.resolve_path(&["std", "sys", "windows", "c", name]).monomorphic_ty(*this.tcx);
+ let ty = this.resolve_path(&["std", "sys", "windows", "c", name]).ty(*this.tcx, ty::ParamEnv::reveal_all());
this.layout_of(ty)
}
fn get_last_error(&self) -> InterpResult<'tcx, Scalar<Tag>> {
let this = self.eval_context_ref();
let errno_place = this.machine.last_error.unwrap();
- this.read_scalar(errno_place.into())?.not_undef()
+ this.read_scalar(errno_place.into())?.check_init()
}
/// Sets the last OS error using a `std::io::Error`. This function tries to produce the most
}
}
}
-
+
fn read_scalar_at_offset(
&self,
op: OpTy<'tcx, Tag>,