Skip to content
Snippets Groups Projects
Commit 8ebb0348 authored by Cheng Shao's avatar Cheng Shao
Browse files

rts: fix top handler closure type signatures

This commit fixes the runIO/runNonIO closure type signatures in the
RTS which should be extern StgClosure. This allows us to remove an
unnecessary type cast in the C foreign desugaring logic, as well as
unneeded complications of JSFFI desugaring logic that also needs to
generate C stubs that may refer to those top handler closures.
Otherwise, we'll have to take special care to avoid generating "extern
StgClosure" declarations for them as we would for other closures, just
to avoid conflicting type signature error at stub compile time.

(cherry picked from commit c78d8f55)
parent 25e75c1f
No related branches found
No related tags found
No related merge requests found
...@@ -515,8 +515,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc ...@@ -515,8 +515,7 @@ mkFExportCBits dflags c_nm maybe_target arg_htys res_hty is_IO_res_ty cc
, text "rts_inCall" <> parens ( , text "rts_inCall" <> parens (
char '&' <> cap <> char '&' <> cap <>
text "rts_apply" <> parens ( text "rts_apply" <> parens (
cap <> cap
text "(HaskellObj)"
<> (if is_IO_res_ty <> (if is_IO_res_ty
then text "runIO_closure" then text "runIO_closure"
else text "runNonIO_closure") else text "runNonIO_closure")
......
...@@ -587,15 +587,15 @@ void rts_done (void); ...@@ -587,15 +587,15 @@ void rts_done (void);
// the base package itself. // the base package itself.
// //
#if defined(COMPILING_WINDOWS_DLL) && !defined(COMPILING_GHC_INTERNAL_PACKAGE) #if defined(COMPILING_WINDOWS_DLL) && !defined(COMPILING_GHC_INTERNAL_PACKAGE)
__declspec(dllimport) extern StgWord ghczminternal_GHCziInternalziTopHandler_runIO_closure[]; __declspec(dllimport) extern StgClosure ghczminternal_GHCziInternalziTopHandler_runIO_closure;
__declspec(dllimport) extern StgWord ghczminternal_GHCziInternalziTopHandler_runNonIO_closure[]; __declspec(dllimport) extern StgClosure ghczminternal_GHCziInternalziTopHandler_runNonIO_closure;
#else #else
extern StgWord ghczminternal_GHCziInternalziTopHandler_runIO_closure[]; extern StgClosure ghczminternal_GHCziInternalziTopHandler_runIO_closure;
extern StgWord ghczminternal_GHCziInternalziTopHandler_runNonIO_closure[]; extern StgClosure ghczminternal_GHCziInternalziTopHandler_runNonIO_closure;
#endif #endif
#define runIO_closure ghczminternal_GHCziInternalziTopHandler_runIO_closure #define runIO_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTopHandler_runIO_closure)
#define runNonIO_closure ghczminternal_GHCziInternalziTopHandler_runNonIO_closure #define runNonIO_closure DLL_IMPORT_DATA_REF(ghczminternal_GHCziInternalziTopHandler_runNonIO_closure)
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment