1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-24 13:32:41 -08:00
emacs/mps/qa/test/testlib/platform.c
Richard Tucker 6120dd4448 Catch memory access errors on w3 (with seh)
Copied from Perforce
 Change: 20281
 ServerID: perforce.ravenbrook.com
1998-10-26 15:21:45 +00:00

44 lines
835 B
C

/* $HopeName: MMQA_harness!testlib:platform.c(trunk.2) $
*/
#include "mps.h"
#include "platform.h"
#include "testlib.h"
#ifdef MPS_OS_SU
void *memmove(void *to, void *from, size_t bytes)
{
bcopy((char *)from, (char *)to, (int)bytes);
return to;
}
#endif
#ifdef MPS_OS_W3
LONG mySEHFilter(LPEXCEPTION_POINTERS info) {
LPEXCEPTION_RECORD er;
int write;
unsigned long address;
er = info->ExceptionRecord;
if (er->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
write = er->ExceptionInformation[0];
address = er->ExceptionInformation[1];
report("memoryerror", "true");
if (write == 1) {
report("memoryop", "write");
} else { /* write == 0 */
report("memoryop", "read");
}
report("memoryaddr", "%ld", address);
myabort();
}
/* otherwise don't interfere */
return EXCEPTION_CONTINUE_SEARCH;
}
#endif