summaryrefslogtreecommitdiff
path: root/rts/LdvProfile.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2016-04-29 07:15:53 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2016-04-29 07:17:19 +1000
commitbcfee2181e7b7edfea3473ec408a3a2a1815ecff (patch)
tree47efe9e4f6d7f49ced2ce8728656d672d3e07e18 /rts/LdvProfile.c
parente20b3ed0d0a3eda9b52544f06694667ddc2dd3a1 (diff)
downloadhaskell-bcfee2181e7b7edfea3473ec408a3a2a1815ecff.tar.gz
rts/LdvProfile.c: Fix NULL dereference on shutdown
Test Plan: validate Reviewers: carter, austin, simonmar, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2154 GHC Trac Issues: #11978
Diffstat (limited to 'rts/LdvProfile.c')
-rw-r--r--rts/LdvProfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/LdvProfile.c b/rts/LdvProfile.c
index 2330d74bd1..4a2ee42424 100644
--- a/rts/LdvProfile.c
+++ b/rts/LdvProfile.c
@@ -178,6 +178,9 @@ processNurseryForDead( void )
StgPtr p;
bdescr *bd;
+ if (MainCapability.r.rNursery == NULL)
+ return;
+
for (bd = MainCapability.r.rNursery->blocks; bd != NULL; bd = bd->link) {
p = bd->start;
while (p < bd->free) {