rts: don't crash on 'hs_init(NULL, NULL)' in debug rts
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 10 Oct 2014 20:43:30 +0000 (21:43 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Fri, 10 Oct 2014 20:57:16 +0000 (21:57 +0100)
commit97b75935ca2cc9d5c9c8dcdb65439dd32af1907b
tree527c166d143763fd5d901ba696637ea470ce6429
parent674c631ea111233daa929ef63500d75ba0db8858
rts: don't crash on 'hs_init(NULL, NULL)' in debug rts

Caught by T6006 as a NULL dereference:

  Command: ./T6006

  Invalid read of size 8
     at 0x660ED9: hs_init_ghc (RtsStartup.c:168)
     by 0x660D90: hs_init (RtsStartup.c:112)
     by 0x40504D: main (in /home/slyfox/dev/git/ghc-validate/testsuite/tests/rts/T6006)
   Address 0x0 is not stack'd, malloc'd or (recently) free'd

The regression was introduced by commit
cb0a503a44bf016de3d9042906c6ac0c0821ffea

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
rts/RtsStartup.c