X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRetainerProfile.c;h=e80a588e86f1ffd6107e4c02342d901d89fb933a;hb=d108044bef62f6a0d579c92ced5e8188f72edc2d;hp=d14ba06bf6ab0fc6b6c7077673ee2daf3779fc13;hpb=70a2431f90fa932733ce015714ef7848640ed48f;p=ghc-hetmet.git diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index d14ba06..e80a588 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -366,7 +366,7 @@ find_srt( stackPos *info ) bitmap = info->next.srt.srt_bitmap; while (bitmap != 0) { if ((bitmap & 1) != 0) { -#if defined(__PIC__) && defined(mingw32_TARGET_OS) +#if defined(__PIC__) && defined(mingw32_HOST_OS) if ((unsigned long)(*(info->next.srt.srt)) & 0x1) c = (* (StgClosure **)((unsigned long)*(info->next.srt.srt)) & ~0x1); else @@ -1054,6 +1054,10 @@ isRetainer( StgClosure *c ) case PAP: // indirection case IND_PERM: + // IND_STATIC used to be an error, but at the moment it can happen + // as isAlive doesn't look through IND_STATIC as it ignores static + // closures. See trac #3956 for a program that hit this error. + case IND_STATIC: case BLACKHOLE: // static objects case CONSTR_STATIC: @@ -1069,8 +1073,6 @@ isRetainer( StgClosure *c ) // // Error case // - // IND_STATIC cannot be *c, *cp, *r in the retainer profiling loop. - case IND_STATIC: // CONSTR_NOCAF_STATIC // cannot be *c, *cp, *r in the retainer profiling loop. case CONSTR_NOCAF_STATIC: @@ -1227,7 +1229,7 @@ retainSRT (StgClosure **srt, nat srt_bitmap, StgClosure *c, retainer c_child_r) while (bitmap != 0) { if ((bitmap & 1) != 0) { -#if defined(__PIC__) && defined(mingw32_TARGET_OS) +#if defined(__PIC__) && defined(mingw32_HOST_OS) if ( (unsigned long)(*srt) & 0x1 ) { retainClosure(* (StgClosure**) ((unsigned long) (*srt) & ~0x1), c, c_child_r);