summaryrefslogtreecommitdiff
path: root/rts/Adjustor.c
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-05-17 23:03:26 +0100
committerIan Lynagh <igloo@earth.li>2012-05-17 23:03:26 +0100
commit89e319cbd0dc6e087c137d0852e5a887fdaa4be4 (patch)
tree23cbe66ed40bfd70c5373e3be20db1798b5a3578 /rts/Adjustor.c
parentb002f1b084a485f99e6c43f20f8060914e18d54d (diff)
downloadhaskell-89e319cbd0dc6e087c137d0852e5a887fdaa4be4.tar.gz
Fix freeHaskellFunctionPtr on Win64
Diffstat (limited to 'rts/Adjustor.c')
-rw-r--r--rts/Adjustor.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/rts/Adjustor.c b/rts/Adjustor.c
index a8bf2a283f..7afdb5f7e2 100644
--- a/rts/Adjustor.c
+++ b/rts/Adjustor.c
@@ -1194,9 +1194,21 @@ freeHaskellFunctionPtr(void* ptr)
}
#elif defined(x86_64_HOST_ARCH)
if ( *(StgWord16 *)ptr == 0x894d ) {
- freeStablePtr(*(StgStablePtr*)((StgWord8*)ptr+0x20));
+ freeStablePtr(*(StgStablePtr*)((StgWord8*)ptr+
+#if defined(mingw32_HOST_OS)
+ 0x28
+#else
+ 0x20
+#endif
+ ));
} else if ( *(StgWord16 *)ptr == 0x5141 ) {
- freeStablePtr(*(StgStablePtr*)((StgWord8*)ptr+0x30));
+ freeStablePtr(*(StgStablePtr*)((StgWord8*)ptr+
+#if defined(mingw32_HOST_OS)
+ 0x38
+#else
+ 0x30
+#endif
+ ));
} else {
errorBelch("freeHaskellFunctionPtr: not for me, guv! %p\n", ptr);
return;