We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4b124d commit 2e0bda8Copy full SHA for 2e0bda8
src/shims/env.rs
@@ -63,6 +63,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
63
let name = this.read_os_str_from_target_str(name_ptr)?;
64
Ok(match this.machine.env_vars.map.get(&name) {
65
Some(var_ptr) => {
66
+ // The offset is used to strip the "{name}=" part of the string.
67
Scalar::from(var_ptr.offset(Size::from_bytes(u64::try_from(name.len()).unwrap().checked_add(1).unwrap()), this)?)
68
}
69
None => Scalar::ptr_null(&*this.tcx),
0 commit comments