Fix segfault with STM; fixes #8035. Patch from errge.
[ghc.git] / rts / Profiling.c
index d43fc6a..ec38c92 100644 (file)
@@ -1067,7 +1067,7 @@ fprintCCS_stderr (CostCentreStack *ccs, StgClosure *exception, StgTSO *tso)
     {
         char *desc;
         StgInfoTable *info;
-        info = get_itbl(exception);
+        info = get_itbl(UNTAG_CLOSURE(exception));
         switch (info->type) {
         case CONSTR:
         case CONSTR_1_0:
@@ -1078,8 +1078,10 @@ fprintCCS_stderr (CostCentreStack *ccs, StgClosure *exception, StgTSO *tso)
         case CONSTR_STATIC:
         case CONSTR_NOCAF_STATIC:
             desc = GET_CON_DESC(itbl_to_con_itbl(info));
-        default:
+            break;
+       default:
             desc = closure_type_names[info->type];
+            break;
         }
         fprintf(stderr, "*** Exception (reporting due to +RTS -xc): (%s), stack trace: \n  ", desc);
     }