summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;