5 #[derive(Debug, Copy, Clone)]
11 pub fn from_str(name: &str) -> Option<Dlsym> {
14 "getentropy" => GetEntropy,
20 impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
21 pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
25 args: &[OpTy<'tcx, Tag>],
26 dest: Option<PlaceTy<'tcx, Tag>>,
27 ret: Option<mir::BasicBlock>,
28 ) -> InterpResult<'tcx> {
31 let this = self.eval_context_mut();
33 let dest = dest.expect("we don't support any diverging dlsym");
34 let ret = ret.expect("dest is `Some` but ret is `None`");
38 let ptr = this.read_scalar(args[0])?.not_undef()?;
39 let len = this.read_scalar(args[1])?.to_usize(this)?;
40 this.gen_random(len as usize, ptr)?;
41 this.write_null(dest)?;
45 this.goto_block(Some(ret))?;
46 this.dump_place(*dest);