Commit bcfee218 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

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
parent e20b3ed0
...@@ -178,6 +178,9 @@ processNurseryForDead( void ) ...@@ -178,6 +178,9 @@ processNurseryForDead( void )
StgPtr p; StgPtr p;
bdescr *bd; bdescr *bd;
if (MainCapability.r.rNursery == NULL)
return;
for (bd = MainCapability.r.rNursery->blocks; bd != NULL; bd = bd->link) { for (bd = MainCapability.r.rNursery->blocks; bd != NULL; bd = bd->link) {
p = bd->start; p = bd->start;
while (p < bd->free) { while (p < bd->free) {
......
main :: IO ()
main = putStrLn "Hello!"
...@@ -106,3 +106,7 @@ test('T11627b', [ extra_run_opts('+RTS -i0 -RTS') # census after each GC ...@@ -106,3 +106,7 @@ test('T11627b', [ extra_run_opts('+RTS -i0 -RTS') # census after each GC
] ]
, compile_and_run , compile_and_run
, ['']) , [''])
test('T11978a',
[only_ways(['profthreaded']), extra_run_opts('+RTS -hb -N10')],
compile_and_run, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment