diff options
Diffstat (limited to 'sim/common/sim-memopt.c')
-rw-r--r-- | sim/common/sim-memopt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sim/common/sim-memopt.c b/sim/common/sim-memopt.c index be52a66..6e12a45 100644 --- a/sim/common/sim-memopt.c +++ b/sim/common/sim-memopt.c @@ -449,6 +449,10 @@ sim_memory_uninstall (SIM_DESC sd) /* delete it and its aliases */ alias = *entry; + + /* next victim */ + *entry = (*entry)->next; + while (alias != NULL) { sim_memopt *dead = alias; @@ -456,9 +460,6 @@ sim_memory_uninstall (SIM_DESC sd) sim_core_detach (sd, NULL, dead->level, dead->space, dead->addr); zfree (dead); } - - /* next victim */ - *entry = (*entry)->next; } } |