fix bad memory information in Interrupt Handler
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@308 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
b53ca0ed7b
commit
35ba78008b
@ -2105,7 +2105,12 @@ absmi(int inp)
|
|||||||
}
|
}
|
||||||
if (PrologMode & AbortMode) {
|
if (PrologMode & AbortMode) {
|
||||||
PrologMode &= ~AbortMode;
|
PrologMode &= ~AbortMode;
|
||||||
|
ASP = Y+E_CB;
|
||||||
|
if (ASP > (CELL *)B)
|
||||||
|
ASP = (CELL *)B;
|
||||||
|
saveregs();
|
||||||
Error(PURE_ABORT, TermNil, "");
|
Error(PURE_ABORT, TermNil, "");
|
||||||
|
setregs();
|
||||||
}
|
}
|
||||||
JMPNext();
|
JMPNext();
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,10 @@ Error (yap_error_number type, Term where, char *format,...)
|
|||||||
/* disallow recursive error handling */
|
/* disallow recursive error handling */
|
||||||
if (PrologMode & InErrorMode)
|
if (PrologMode & InErrorMode)
|
||||||
return(P);
|
return(P);
|
||||||
if (type != PURE_ABORT)
|
/* PURE_ABORT may not have set where correctly */
|
||||||
|
if (type == PURE_ABORT)
|
||||||
|
where = TermNil;
|
||||||
|
else
|
||||||
where = Deref(where);
|
where = Deref(where);
|
||||||
if (IsVarTerm(where)) {
|
if (IsVarTerm(where)) {
|
||||||
/* we must be careful someone gave us a copy to a local variable */
|
/* we must be careful someone gave us a copy to a local variable */
|
||||||
|
23
C/sysbits.c
23
C/sysbits.c
@ -1936,9 +1936,11 @@ static Int p_file_age(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* wrapper for alarm system call */
|
/* wrapper for alarm system call */
|
||||||
#if defined(_WIN32)
|
#if _MSC_VER || defined(__MINGW32__)
|
||||||
|
|
||||||
static VOID CALLBACK HandleTimer(LPVOID v, DWORD d1, DWORD d2) {
|
static VOID CALLBACK HandleTimer(LPVOID v, DWORD d1, DWORD d2) {
|
||||||
/* force the system to creep */
|
/* force the system to creep */
|
||||||
|
exit(0);
|
||||||
p_creep ();
|
p_creep ();
|
||||||
/* now, say what is going on */
|
/* now, say what is going on */
|
||||||
PutValue(AtomAlarm, MkAtomTerm(AtomTrue));
|
PutValue(AtomAlarm, MkAtomTerm(AtomTrue));
|
||||||
@ -1960,16 +1962,25 @@ p_alarm(void)
|
|||||||
#if _MSC_VER || defined(__MINGW32__)
|
#if _MSC_VER || defined(__MINGW32__)
|
||||||
{
|
{
|
||||||
Term tout;
|
Term tout;
|
||||||
HANDLE htimer = CreateWaitableTimer(NULL,FALSE,NULL);
|
HANDLE htimer;
|
||||||
LARGE_INTEGER due_time;
|
Int time = -IntegerOfTerm(t);
|
||||||
__int64 timeout = -IntegerOfTerm(t);
|
|
||||||
due_time.QuadPart = timeout;
|
|
||||||
|
|
||||||
if (SetWaitableTimer(htimer, &due_time,0,HandleTimer,NULL,TRUE) == 0) {
|
if (time != 0) {
|
||||||
|
__int64 due_time;
|
||||||
|
LARGE_INTEGER liDueTime;
|
||||||
|
|
||||||
|
htimer = CreateWaitableTimer(NULL,FALSE,NULL);
|
||||||
|
due_time = time;
|
||||||
|
due_time *= 10000000;
|
||||||
|
/* Copy the relative time into a LARGE_INTEGER. */
|
||||||
|
liDueTime.LowPart = (DWORD) ( due_time & 0xFFFFFFFF );
|
||||||
|
liDueTime.HighPart = (LONG) ( due_time >> 32 );
|
||||||
|
if (SetWaitableTimer(htimer, &liDueTime,0,HandleTimer,NULL,0) == 0) {
|
||||||
Error(SYSTEM_ERROR, TermNil,
|
Error(SYSTEM_ERROR, TermNil,
|
||||||
"alarm not available in this configuration");
|
"alarm not available in this configuration");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
tout = MkIntegerTerm(0);
|
tout = MkIntegerTerm(0);
|
||||||
return(unify(ARG2,tout));
|
return(unify(ARG2,tout));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user