This commit is contained in:
Vitor Santos Costa
2018-04-09 13:42:06 +01:00
parent 2d19db5fce
commit 04c38ecc29
4 changed files with 14 additions and 10 deletions

View File

@@ -358,7 +358,6 @@ bool Yap_HandleError__(const char *file, const char *function, int lineno,
const char *serr;
arity_t arity = 2;
if (LOCAL_ErrorMessage) {
serr = LOCAL_ErrorMessage;
} else {
@@ -379,6 +378,7 @@ bool Yap_HandleError__(const char *file, const char *function, int lineno,
serr);
return false;
}
LOCAL_PrologMode = UserMode;
return true;
case RESOURCE_ERROR_AUXILIARY_STACK:
if (LOCAL_MAX_SIZE < (char *)AuxSp - AuxBase) {
@@ -390,6 +390,7 @@ bool Yap_HandleError__(const char *file, const char *function, int lineno,
ARG1, serr);
return false;
}
LOCAL_PrologMode = UserMode;
return true;
case RESOURCE_ERROR_HEAP:
if (!Yap_growheap(FALSE, 0, NULL)) {
@@ -398,7 +399,9 @@ bool Yap_HandleError__(const char *file, const char *function, int lineno,
return false;
}
default:
Yap_Error__(false, file, function, lineno, err, TermNil, serr);
if (LOCAL_PrologMode == UserMode)
Yap_Error__(false, file, function, lineno, err, TermNil, serr);
return false;
}
}
@@ -1013,6 +1016,8 @@ static Int get_exception(USES_REGS1) {
Int rc = Yap_unify(t, ARG1);
return rc;
}
LOCAL_CommittedError = NULL;
return false;
}

View File

@@ -817,7 +817,7 @@ static bool watch_cut(Term ext USES_REGS) {
}
CELL *port_pt = deref_ptr(RepAppl(task) + 2);
CELL *completion_pt = deref_ptr(RepAppl(task) + 4);
if (LOCAL_CommittedError) {
if (LOCAL_CommittedError && LOCAL_CommittedError->errorNo != YAP_NO_ERROR) {
e = MkErrorTerm(LOCAL_CommittedError);
Term t;
if (active) {