diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-09-04 11:08:10 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-09-04 11:11:10 +0100 |
commit | 1fb558d13d702246fe45b11d78011f32910d90b7 (patch) | |
tree | 1ee6cf8f54527cefc571e25247adbc071ba44aff /rts/CheckUnload.c | |
parent | 356f793917439c37c140e3e76963e2f0e391dc64 (diff) | |
download | haskell-1fb558d13d702246fe45b11d78011f32910d90b7.tar.gz |
Don't refer to oc->next after freeing oc.
Diffstat (limited to 'rts/CheckUnload.c')
-rw-r--r-- | rts/CheckUnload.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/CheckUnload.c b/rts/CheckUnload.c index 0485ed4887..d3fb8934b5 100644 --- a/rts/CheckUnload.c +++ b/rts/CheckUnload.c @@ -246,7 +246,7 @@ void checkUnload (StgClosure *static_objects) HashTable *addrs; StgClosure* p; const StgInfoTable *info; - ObjectCode *oc, *prev; + ObjectCode *oc, *prev, *next; gen_workspace *ws; StgClosure* link; @@ -283,7 +283,8 @@ void checkUnload (StgClosure *static_objects) // marked as unreferenced can be physically unloaded, because we // have no references to it. prev = NULL; - for (oc = unloaded_objects; oc; prev = oc, oc = oc->next) { + for (oc = unloaded_objects; oc; prev = oc, oc = next) { + next = oc->next; if (oc->referenced == 0) { if (prev == NULL) { unloaded_objects = oc->next; |