File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -285,8 +285,9 @@ environment variable. We first document the most relevant and most commonly used
285
285
harness](https://github.com/rust-lang/miri/issues/1702). This has no effect unless
286
286
` -Zmiri-disable-isolation` is also set.
287
287
* `-Zmiri-env-forward=<var>` forwards the `var` environment variable to the interpreted program. Can
288
- be used multiple times to forward several variables. This has no effect if
289
- ` -Zmiri-disable-isolation` is set.
288
+ be used multiple times to forward several variables. This takes precedence over
289
+ `-Zmiri-env-exclude` : if a variable is both forwarded and exluced, it *will* get forwarded. This
290
+ means in particular `-Zmiri-env-forward=TERM` overwrites the default exclusion of `TERM`.
290
291
* `-Zmiri-ignore-leaks` disables the memory leak checker, and also allows some
291
292
remaining threads to exist when the main thread exits.
292
293
* `-Zmiri-permissive-provenance` disables the warning for integer-to-pointer casts and
Original file line number Diff line number Diff line change @@ -50,10 +50,10 @@ impl<'tcx> EnvVars<'tcx> {
50
50
// Skip the loop entirely if we don't want to forward anything.
51
51
if ecx. machine . communicate ( ) || !config. forwarded_env_vars . is_empty ( ) {
52
52
for ( name, value) in env:: vars_os ( ) {
53
- let forward = match ecx . machine . communicate ( ) {
54
- true => !excluded_env_vars . iter ( ) . any ( |v| * * v == name) ,
55
- false => config . forwarded_env_vars . iter ( ) . any ( |v| * * v == name ) ,
56
- } ;
53
+ // Always forward what is in `forwarded_env_vars`; that list can take precedence over excluded_env_vars.
54
+ let forward = config . forwarded_env_vars . iter ( ) . any ( |v| * * v == name)
55
+ || ( ecx . machine . communicate ( )
56
+ && !excluded_env_vars . iter ( ) . any ( |v| * * v == name ) ) ;
57
57
if forward {
58
58
let var_ptr = match target_os {
59
59
target if target_os_is_unix ( target) =>
You can’t perform that action at this time.
0 commit comments