summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/Printer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/rts/Printer.c b/rts/Printer.c
index 38335aa963..f4d1111892 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -111,10 +111,15 @@ printThunkObject( StgThunk *obj, char* tag )
void
printClosure( const StgClosure *obj )
{
- const StgInfoTable *info;
-
+ debugBelch("%p: ", obj);
obj = UNTAG_CONST_CLOSURE(obj);
- info = get_itbl(obj);
+ const StgInfoTable* info = get_itbl(obj);
+
+ while (IS_FORWARDING_PTR(info)) {
+ obj = (StgClosure*)UN_FORWARDING_PTR(obj);
+ debugBelch("(forwarding to %p) ", (void*)obj);
+ info = get_itbl(obj);
+ }
switch ( info->type ) {
case INVALID_OBJECT: