summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-06-13 10:29:28 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-06-13 10:29:28 +0000
commit23e5985c3db852981d527d10d6a6271688049790 (patch)
tree7b87dd13cdbbebb56be5e530fe524bd5694a2d22 /compiler/codeGen
parent62d948405f6b9a95fe4b31b7cffa387e5425d6db (diff)
downloadhaskell-23e5985c3db852981d527d10d6a6271688049790.tar.gz
FIX #1418 (partially)
When the con_desc field of an info table was made into a relative reference, this had the side effect of making the profiling fields (closure_desc and closure_type) also relative, but only when compiling via C, and the heap profiler was still treating them as absolute, leading to crashes when profiling with -hd or -hy. This patch fixes up the story to be consistent: these fields really should be relative (otherwise we couldn't make shared versions of the profiling libraries), so I've made them relative and fixed up the RTS to know about this.
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/CgInfoTbls.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/codeGen/CgInfoTbls.hs b/compiler/codeGen/CgInfoTbls.hs
index e2e07f94ca..62a6db2110 100644
--- a/compiler/codeGen/CgInfoTbls.hs
+++ b/compiler/codeGen/CgInfoTbls.hs
@@ -74,11 +74,13 @@ emitClosureCodeAndInfoTable :: ClosureInfo -> [LocalReg] -> CgStmts -> Code
emitClosureCodeAndInfoTable cl_info args body
= do { ty_descr_lit <-
if opt_SccProfilingOn
- then mkStringCLit (closureTypeDescr cl_info)
+ then do lit <- mkStringCLit (closureTypeDescr cl_info)
+ return (makeRelativeRefTo info_lbl lit)
else return (mkIntCLit 0)
; cl_descr_lit <-
if opt_SccProfilingOn
- then mkStringCLit cl_descr_string
+ then do lit <- mkStringCLit cl_descr_string
+ return (makeRelativeRefTo info_lbl lit)
else return (mkIntCLit 0)
; let std_info = mkStdInfoTable ty_descr_lit cl_descr_lit
cl_type srt_len layout_lit