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; const char *serr;
arity_t arity = 2; arity_t arity = 2;
if (LOCAL_ErrorMessage) { if (LOCAL_ErrorMessage) {
serr = LOCAL_ErrorMessage; serr = LOCAL_ErrorMessage;
} else { } else {
@ -379,6 +378,7 @@ bool Yap_HandleError__(const char *file, const char *function, int lineno,
serr); serr);
return false; return false;
} }
LOCAL_PrologMode = UserMode;
return true; return true;
case RESOURCE_ERROR_AUXILIARY_STACK: case RESOURCE_ERROR_AUXILIARY_STACK:
if (LOCAL_MAX_SIZE < (char *)AuxSp - AuxBase) { if (LOCAL_MAX_SIZE < (char *)AuxSp - AuxBase) {
@ -390,6 +390,7 @@ bool Yap_HandleError__(const char *file, const char *function, int lineno,
ARG1, serr); ARG1, serr);
return false; return false;
} }
LOCAL_PrologMode = UserMode;
return true; return true;
case RESOURCE_ERROR_HEAP: case RESOURCE_ERROR_HEAP:
if (!Yap_growheap(FALSE, 0, NULL)) { if (!Yap_growheap(FALSE, 0, NULL)) {
@ -398,7 +399,9 @@ bool Yap_HandleError__(const char *file, const char *function, int lineno,
return false; return false;
} }
default: 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; return false;
} }
} }
@ -1013,6 +1016,8 @@ static Int get_exception(USES_REGS1) {
Int rc = Yap_unify(t, ARG1); Int rc = Yap_unify(t, ARG1);
return rc; return rc;
} }
LOCAL_CommittedError = NULL;
return false; 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 *port_pt = deref_ptr(RepAppl(task) + 2);
CELL *completion_pt = deref_ptr(RepAppl(task) + 4); CELL *completion_pt = deref_ptr(RepAppl(task) + 4);
if (LOCAL_CommittedError) { if (LOCAL_CommittedError && LOCAL_CommittedError->errorNo != YAP_NO_ERROR) {
e = MkErrorTerm(LOCAL_CommittedError); e = MkErrorTerm(LOCAL_CommittedError);
Term t; Term t;
if (active) { if (active) {

View File

@ -227,15 +227,15 @@ print_message(L,E) :-
'$command'(C,VL,Pos,Con) :- '$command'(C,VL,Pos,Con) :-
( (Con = top ; var(C) ; C = [_|_]) -> ( (Con = top ; var(C) ; C = [_|_]) ->
'$yap_strip_module'(C, EM, EG), '$yap_strip_module'(C, EM, EG),
'$execute_command'(EG,EM,VL,Pos,Con,C), ! ; '$execute_command'(EG,EM,VL,Pos,Con,C) ;
% do term expansion % do term expansion
'$expand_term'(C, Con, EC), '$expand_term'(C, Con, EC),
'$yap_strip_module'(EC, EM, EG), '$yap_strip_module'(EC, EM, EG),
% execute a list of commands % execute a list of commands
'$execute_commands'(EG,EM,VL,Pos,Con,_Source), '$execute_commands'(EG,EM,VL,Pos,Con,_Source)
),
% succeed only if the *original* was at end of file. % succeed only if the *original* was at end of file.
C == end_of_file C == end_of_file.
).
:- c_compile('arith.yap'). :- c_compile('arith.yap').
%:- stop_low_level_trace. %:- stop_low_level_trace.

View File

@ -260,8 +260,7 @@ tinfo(Reg) -->
tinfo(Reg). tinfo(Reg).
addinfo( Desc) --> addinfo( Desc) -->
( ; ( [[p]]
[[p]]
-> ->
[] []
; ;
@ -807,7 +806,7 @@ print_lines( S, Prefixes, Key) -->
{ nl(S), { nl(S),
Prefixes = [PrefixS - Cmds|More], Prefixes = [PrefixS - Cmds|More],
format(S, PrefixS, []Cmds) format(S, PrefixS, []Cmds)
} },
{ {
More == [] More == []
-> ->