summaryrefslogtreecommitdiff
path: root/rts/RtsStartup.c
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2014-10-10 21:43:30 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2014-10-10 21:57:16 +0100
commit97b75935ca2cc9d5c9c8dcdb65439dd32af1907b (patch)
tree527c166d143763fd5d901ba696637ea470ce6429 /rts/RtsStartup.c
parent674c631ea111233daa929ef63500d75ba0db8858 (diff)
downloadhaskell-97b75935ca2cc9d5c9c8dcdb65439dd32af1907b.tar.gz
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>
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r--rts/RtsStartup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 5e6f9fab54..32bed5af8f 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -161,12 +161,12 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
setFullProgArgv(*argc,*argv);
setupRtsFlags(argc, *argv,
rts_config.rts_opts_enabled, rts_config.rts_opts, rts_config.rts_hs_main);
- }
#ifdef DEBUG
- /* load debugging symbols for current binary */
- DEBUG_LoadSymbols((*argv)[0]);
+ /* load debugging symbols for current binary */
+ DEBUG_LoadSymbols((*argv)[0]);
#endif /* DEBUG */
+ }
/* Initialise the stats department, phase 1 */
initStats1();