undef should not fail immediately: it needs to test for exports first
This commit is contained in:
parent
e92062886b
commit
c5323b2920
@ -888,10 +888,7 @@ static int interrupt_dexecute(USES_REGS1) {
|
||||
|
||||
static void undef_goal(USES_REGS1) {
|
||||
PredEntry *pe = PredFromDefCode(P);
|
||||
if (Yap_UnknownFlag(CurrentModule) == TermFail) {
|
||||
P = FAILCODE;
|
||||
return;
|
||||
}
|
||||
|
||||
BEGD(d0);
|
||||
/* avoid trouble with undefined dynamic procedures */
|
||||
/* I assume they were not locked beforehand */
|
||||
|
@ -273,13 +273,18 @@ private(_).
|
||||
'$handle_error'(_Action,_G0,_M0) :- fail.
|
||||
|
||||
% cases where we cannot afford to ever fail.
|
||||
'$undefp'([_|print_message(Context, Msg)], true) :- !,
|
||||
'$undefp'([ImportingMod|G], _) :- !,
|
||||
recorded('$import','$import'(ExportingModI,ImportingMod,G,G0I,_,_),_), !,
|
||||
% writeln('$execute0'(G0I, ExportingModI)),
|
||||
'$execute0'(G0I, ExportingModI).
|
||||
'$undefp'([_|print_message(Context, Msg)], _) :- !,
|
||||
'$early_print_message'(Context, Msg).
|
||||
% undef handler
|
||||
'$undefp'([M0|G0], Action) :-
|
||||
% make sure we do not loop on undefined predicates
|
||||
'$stop_creeping'(Current),
|
||||
yap_flag( unknown, Action, fail),
|
||||
Action\=fail,
|
||||
% yap_flag( debug, Debug, false),
|
||||
(
|
||||
'$undefp_search'(M0:G0, NM:NG),
|
||||
|
@ -82,7 +82,7 @@ followed by the failure of that call.
|
||||
:- '$set_no_trace'('$handle_error'(_,_,_), prolog).
|
||||
|
||||
/**
|
||||
Z * @pred '$undefp_expand'(+ M0:G0, -MG)
|
||||
* @pred '$undefp_expand'(+ M0:G0, -MG)
|
||||
*
|
||||
* @param G0 input goal
|
||||
* @param M0 current module
|
||||
|
Reference in New Issue
Block a user