[commit: ghc] master: prettyPrintClosure(): Untag the closure before accessing fields (b0a7664)

git at git.haskell.org git at git.haskell.org
Fri Jun 10 10:17:55 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b0a76643e979a2e5198875a9c99f5f625f318668/ghc

>---------------------------------------------------------------

commit b0a76643e979a2e5198875a9c99f5f625f318668
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Fri Jun 10 06:20:00 2016 -0400

    prettyPrintClosure(): Untag the closure before accessing fields
    
    (This fixes segfaults)


>---------------------------------------------------------------

b0a76643e979a2e5198875a9c99f5f625f318668
 rts/Printer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rts/Printer.c b/rts/Printer.c
index c33e341..a6f26c2 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -805,6 +805,8 @@ void prettyPrintClosure_ (const StgClosure *obj)
 {
     const StgInfoTable *info;
 
+    obj = UNTAG_CONST_CLOSURE(obj);
+
     /* collapse any indirections */
     unsigned int type;
     type = get_itbl(obj)->type;



More information about the ghc-commits mailing list