diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2019-07-17 14:56:40 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-02-17 11:21:11 -0500 |
commit | fc4bd5567284744d887ef4c5d8262732096d44ee (patch) | |
tree | 1fd5669be62444302f8238ed79bc0a6882fb30f3 /rts | |
parent | 79bb81fec261815c650f141d3c75ab98250177e9 (diff) | |
download | haskell-fc4bd5567284744d887ef4c5d8262732096d44ee.tar.gz |
rts: TraverseHeap: Allow visit_cb to be NULL
Diffstat (limited to 'rts')
-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; |