summaryrefslogtreecommitdiff
path: root/rts/CheckUnload.c
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-04-12 23:02:13 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-04-12 23:36:45 -0700
commite3938f3adac0093b23694fd347774244ce121478 (patch)
tree9997d4183c08da311094cfc59286513b50cabf22 /rts/CheckUnload.c
parent7233638ba6e82179cc4bd1b981eff5292b18e118 (diff)
downloadhaskell-e3938f3adac0093b23694fd347774244ce121478.tar.gz
Fix linked list manipulation code (buggy on consecutive deletion)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'rts/CheckUnload.c')
-rw-r--r--rts/CheckUnload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/CheckUnload.c b/rts/CheckUnload.c
index f1f454ceaf..98f184b84c 100644
--- a/rts/CheckUnload.c
+++ b/rts/CheckUnload.c
@@ -298,7 +298,7 @@ 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 = next) {
+ for (oc = unloaded_objects; oc; oc = next) {
next = oc->next;
if (oc->referenced == 0) {
if (prev == NULL) {
@@ -312,6 +312,7 @@ void checkUnload (StgClosure *static_objects)
} else {
IF_DEBUG(linker, debugBelch("Object file still in use: %"
PATH_FMT "\n", oc->fileName));
+ prev = oc;
}
}