From aa47e9aaabf6b11875749923c2e2726a30235e0a Mon Sep 17 00:00:00 2001 From: panne Date: Sun, 22 Aug 2004 16:40:38 +0000 Subject: [PATCH] [project @ 2004-08-22 16:40:38 by panne] Terminate program if execPage fails, this is more honest and simplifies things a bit. --- ghc/includes/Rts.h | 4 ++-- ghc/rts/Adjustor.c | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/ghc/includes/Rts.h b/ghc/includes/Rts.h index 96840bc..1b07a84 100644 --- a/ghc/includes/Rts.h +++ b/ghc/includes/Rts.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Rts.h,v 1.25 2004/08/21 12:47:17 panne Exp $ + * $Id: Rts.h,v 1.26 2004/08/22 16:40:38 panne Exp $ * * (c) The GHC Team, 1998-1999 * @@ -174,7 +174,7 @@ extern void __decodeFloat (MP_INT *man, I_ *_exp, StgFloat flt); #endif /* Initialising the whole adjustor thunk machinery. */ -extern rtsBool initAdjustor(void); +extern void initAdjustor(void); extern void stg_exit(int n) GNU_ATTRIBUTE(__noreturn__); diff --git a/ghc/rts/Adjustor.c b/ghc/rts/Adjustor.c index da8951c..44fbcf2 100644 --- a/ghc/rts/Adjustor.c +++ b/ghc/rts/Adjustor.c @@ -61,7 +61,7 @@ typedef enum { * TODO: Can the code span more than one page? If yes, we need to make two * pages executable! */ -static rtsBool +static void execPage (void* addr, pageMode mode) { #if defined(i386_TARGET_ARCH) && defined(_WIN32) && 0 @@ -75,16 +75,11 @@ execPage (void* addr, pageMode mode) sInfo.dwPageSize, ( mode == pageExecuteReadWrite ? PAGE_EXECUTE_READWRITE : PAGE_EXECUTE_READ), &dwOldProtect) == 0 ) { -# if 1 DWORD rc = GetLastError(); - prog_belch("execPage: failed to protect 0x%p; error=%lu; old protection: %lu\n", addr, rc, dwOldProtect); -# endif - return rtsFalse; + barf("execPage: failed to protect 0x%p; error=%lu; old protection: %lu\n", addr, rc, dwOldProtect); } - return rtsTrue; #else (void)addr; (void)mode; /* keep gcc -Wall happy */ - return rtsTrue; #endif } @@ -563,7 +558,7 @@ freeHaskellFunctionPtr(void* ptr) * * Perform initialisation of adjustor thunk layer (if needed.) */ -rtsBool +void initAdjustor(void) { #if defined(i386_TARGET_ARCH) @@ -594,5 +589,4 @@ initAdjustor(void) execPage(obscure_ccall_ret_code, pageExecuteRead); #endif - return rtsTrue; } -- 1.7.10.4