X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FSanity.c;h=c9a07725430cba314aac8b0d185239d2d4924a59;hb=b84b5969798530dbf5be9b8bb795b77e5dfbf042;hp=dcb6e5b5ea97169c9f0b674010ae672c9b7ddb1e;hpb=1ed01a871030f05905a9595e4837dfffc087ef64;p=ghc-hetmet.git diff --git a/rts/Sanity.c b/rts/Sanity.c index dcb6e5b..c9a0772 100644 --- a/rts/Sanity.c +++ b/rts/Sanity.c @@ -204,12 +204,13 @@ checkStackChunk( StgPtr sp, StgPtr stack_end ) } static void -checkPAP (StgClosure *fun, StgClosure** payload, StgWord n_args) +checkPAP (StgClosure *tagged_fun, StgClosure** payload, StgWord n_args) { + StgClosure *fun; StgClosure *p; StgFunInfoTable *fun_info; - fun = UNTAG_CLOSURE(fun); + fun = UNTAG_CLOSURE(tagged_fun); ASSERT(LOOKS_LIKE_CLOSURE_PTR(fun)); fun_info = get_fun_itbl(fun); @@ -235,6 +236,9 @@ checkPAP (StgClosure *fun, StgClosure** payload, StgWord n_args) n_args ); break; } + + ASSERT(fun_info->f.arity > TAG_MASK ? GET_CLOSURE_TAG(tagged_fun) == 1 + : GET_CLOSURE_TAG(tagged_fun) == fun_info->f.arity); }