diff options
-rw-r--r-- | rts/TraverseHeap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/TraverseHeap.c b/rts/TraverseHeap.c index 40a70e2a50..c66230ee75 100644 --- a/rts/TraverseHeap.c +++ b/rts/TraverseHeap.c @@ -1207,8 +1207,10 @@ inner_loop: // If this is the first visit to c, initialize its data. bool first_visit = traverseMaybeInitClosureData(ts, c); - bool traverse_children - = visit_cb(c, cp, data, first_visit, &accum, &child_data); + bool traverse_children = first_visit; + if(visit_cb) + traverse_children = visit_cb(c, cp, data, first_visit, + &accum, &child_data); if(!traverse_children) goto loop; |