prettyPrintClosure(): Untag the closure before accessing fields
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Fri, 10 Jun 2016 10:20:00 +0000 (06:20 -0400)
committerÖmer Sinan Ağacan <omeragacan@gmail.com>
Fri, 10 Jun 2016 10:20:00 +0000 (06:20 -0400)
(This fixes segfaults)

rts/Printer.c

index c33e341..a6f26c2 100644 (file)
@@ -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;