summaryrefslogtreecommitdiff
path: root/rts/win32
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2016-01-10 07:20:57 +0100
committerTamar Christina <tamar@zhox.com>2016-01-14 21:25:15 +0100
commitdb371c10a2da722a18b0d5bc042eb2d02ba60e1b (patch)
tree330d2a4fe1aba65d81572405a6f1802bc6e97b00 /rts/win32
parentfd686c43c45b68fec97ae4c45709358798af6121 (diff)
downloadhaskell-db371c10a2da722a18b0d5bc042eb2d02ba60e1b.tar.gz
T11300: Fix test on windows
Summary: Fix exit code for Windows to match expected for out-of-memory test Test Plan: ./validate Reviewers: simonmar, austin, thomie, bgamari Reviewed By: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1753 GHC Trac Issues: #11422
Diffstat (limited to 'rts/win32')
-rw-r--r--rts/win32/OSMem.c5
-rw-r--r--rts/win32/veh_excn.c9
2 files changed, 7 insertions, 7 deletions
diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c
index 47e24f077a..0009a4ec9d 100644
--- a/rts/win32/OSMem.c
+++ b/rts/win32/OSMem.c
@@ -59,7 +59,8 @@ allocNew(nat n) {
rec=0;
if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) {
- errorBelch("out of memory");
+ errorBelch("Out of memory");
+ stg_exit(EXIT_HEAPOVERFLOW);
} else {
sysErrorBelch(
"getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n);
@@ -177,7 +178,7 @@ commitBlocks(char* base, W_ size) {
temp = VirtualAlloc(base, size_delta, MEM_COMMIT, PAGE_READWRITE);
if(temp==0) {
sysErrorBelch("getMBlocks: VirtualAlloc MEM_COMMIT failed");
- stg_exit(EXIT_FAILURE);
+ stg_exit(EXIT_HEAPOVERFLOW);
}
size-=size_delta;
base+=size_delta;
diff --git a/rts/win32/veh_excn.c b/rts/win32/veh_excn.c
index a24354e9d6..bf2151a59a 100644
--- a/rts/win32/veh_excn.c
+++ b/rts/win32/veh_excn.c
@@ -23,21 +23,20 @@
// this should be in <excpt.h>, but it's been removed from MinGW distributions
#ifndef EH_UNWINDING
-#define EH_UNWINDING 0x02
+#define EH_UNWINDING 0x02
#endif /* EH_UNWINDING */
// Registered exception handler
PVOID __hs_handle = NULL;
long WINAPI __hs_exception_handler(struct _EXCEPTION_POINTERS *exception_data)
-{
+{
long action = EXCEPTION_CONTINUE_SEARCH;
// When the system unwinds the VEH stack after having handled an excn,
// return immediately.
if ((exception_data->ExceptionRecord->ExceptionFlags & EH_UNWINDING) == 0)
{
-
// Error handling cases covered by this implementation.
switch (exception_data->ExceptionRecord->ExceptionCode) {
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
@@ -62,7 +61,7 @@ long WINAPI __hs_exception_handler(struct _EXCEPTION_POINTERS *exception_data)
if (EXCEPTION_CONTINUE_EXECUTION == action)
{
fflush(stdout);
- stg_exit(1);
+ stg_exit(EXIT_FAILURE);
}
}
@@ -88,7 +87,7 @@ void __unregister_hs_exception_handler( void )
{
if (__hs_handle != NULL)
{
- // Should the return value be checked? we're terminating anyway.
+ // Should the return value be checked? we're terminating anyway.
RemoveVectoredExceptionHandler(__hs_handle);
__hs_handle = NULL;
}