rts: fix threadStackUnderflow type in cmm
authorSergei Trofimovich <siarheit@google.com>
Fri, 11 Mar 2016 22:31:58 +0000 (22:31 +0000)
committerSergei Trofimovich <siarheit@google.com>
Fri, 11 Mar 2016 23:19:47 +0000 (23:19 +0000)
commite46742f5c51938bc7c992ac37fecc6df8cab7647
tree2170df7cc8257e8c0d139633c0c25af3c4a4f829
parent2f45cf3f48162a5f843005755dafa1c5c1b451a7
rts: fix threadStackUnderflow type in cmm

stg_stack_underflow_frame had an incorrect
call of C function 'threadStackUnderflow':
    ("ptr" ret_off) =
      foreign "C" threadStackUnderflow(
        MyCapability(),
        CurrentTSO);

Which means it's prototype is:
    void * (*) (W_, void*);
While real prototype is:
    W_ (*) (Capability *cap, StgTSO *tso);

The fix is simple. Fix type annotations:
    (ret_off) =
      foreign "C" threadStackUnderflow(
        MyCapability() "ptr",
        CurrentTSO "ptr");

Noticed when debugged T9045 test failure
on m68k target which distincts between
pointer and non pointer return types
(uses different registers)

While at it noticed and fixed return types
for 'throwTo' and 'findSpark'.

Trac #11395

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
rts/Exception.cmm
rts/PrimOps.cmm
rts/StgMiscClosures.cmm