File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
4242 MemoryExtra :: new ( StdRng :: seed_from_u64 ( config. seed . unwrap_or ( 0 ) ) , config. validate ) ,
4343 ) ;
4444 // Complete initialization.
45- EnvVars :: init ( & mut ecx) ;
45+ EnvVars :: init ( & mut ecx, config . excluded_env_vars ) ;
4646
4747 // Setup first stack-frame
4848 let main_instance = ty:: Instance :: mono ( ecx. tcx . tcx , main_id) ;
Original file line number Diff line number Diff line change @@ -15,11 +15,14 @@ pub struct EnvVars {
1515impl EnvVars {
1616 pub ( crate ) fn init < ' mir , ' tcx > (
1717 ecx : & mut InterpCx < ' mir , ' tcx , Evaluator < ' tcx > > ,
18+ excluded_env_vars : Vec < String > ,
1819 ) {
1920 if ecx. machine . communicate {
2021 for ( name, value) in std:: env:: vars ( ) {
21- let var_ptr = alloc_env_var ( name. as_bytes ( ) , value. as_bytes ( ) , ecx. memory_mut ( ) ) ;
22- ecx. machine . env_vars . map . insert ( name. into_bytes ( ) , var_ptr) ;
22+ if !excluded_env_vars. contains ( & name) {
23+ let var_ptr = alloc_env_var ( name. as_bytes ( ) , value. as_bytes ( ) , ecx. memory_mut ( ) ) ;
24+ ecx. machine . env_vars . map . insert ( name. into_bytes ( ) , var_ptr) ;
25+ }
2326 }
2427 }
2528 }
You can’t perform that action at this time.
0 commit comments