aboutsummaryrefslogtreecommitdiff
path: root/sim/pru
diff options
context:
space:
mode:
Diffstat (limited to 'sim/pru')
-rw-r--r--sim/pru/interp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sim/pru/interp.c b/sim/pru/interp.c
index ca640f4..f243df9 100644
--- a/sim/pru/interp.c
+++ b/sim/pru/interp.c
@@ -848,5 +848,11 @@ sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd,
STATE_PROG_ARGV (sd) = dupargv (argv);
}
+ if (STATE_PROG_ENVP (sd) != env)
+ {
+ freeargv (STATE_PROG_ENVP (sd));
+ STATE_PROG_ENVP (sd) = dupargv (env);
+ }
+
return SIM_RC_OK;
}