make sure to initialise u.Code in dbase.c
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@745 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
3d5b22a732
commit
8a72ec94b9
25
C/dbase.c
25
C/dbase.c
@ -1508,8 +1508,9 @@ CreateDBStruct(Term Tm, DBProp p, int InFlag)
|
||||
while (ptr != tofref)
|
||||
*rfnar++ = *--ptr;
|
||||
pp->u.DBRefs = rfnar;
|
||||
|
||||
}
|
||||
} else {
|
||||
pp->u.DBRefs = NULL;
|
||||
}
|
||||
Yap_ReleasePreAllocCodeSpace((ADDR)pp0);
|
||||
return (pp);
|
||||
}
|
||||
@ -1768,30 +1769,31 @@ p_rcdap(void)
|
||||
Term TRef, t1 = Deref(ARG1), t2 = Deref(ARG2);
|
||||
|
||||
if (!IsVarTerm(Deref(ARG3)))
|
||||
return (FALSE);
|
||||
return FALSE;
|
||||
restart_record:
|
||||
TRef = MkDBRefTerm(record(MkFirst | MkCode, t1, t2, Unsigned(0)));
|
||||
switch(DBErrorFlag) {
|
||||
case NO_ERROR_IN_DB:
|
||||
return (Yap_unify(ARG3, TRef));
|
||||
return Yap_unify(ARG3, TRef);
|
||||
case SOVF_ERROR_IN_DB:
|
||||
if (!Yap_gc(3, ENV, P)) {
|
||||
Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage);
|
||||
return(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
goto recover_record;
|
||||
case TOVF_ERROR_IN_DB:
|
||||
Yap_Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
|
||||
return(FALSE);
|
||||
return FALSE;
|
||||
case OVF_ERROR_IN_DB:
|
||||
if (!Yap_growheap(FALSE)) {
|
||||
Yap_Error(SYSTEM_ERROR, TermNil, Yap_ErrorMessage);
|
||||
return(FALSE);
|
||||
} else
|
||||
return FALSE;
|
||||
} else {
|
||||
goto recover_record;
|
||||
}
|
||||
default:
|
||||
Yap_Error(DBErrorNumber, DBErrorTerm, DBErrorMsg);
|
||||
return(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
recover_record:
|
||||
DBErrorFlag = NO_ERROR_IN_DB;
|
||||
@ -3750,7 +3752,8 @@ PrepareToEraseLogUpdClause(Clause *clau, DBRef dbr)
|
||||
|
||||
static void
|
||||
PrepareToEraseClause(Clause *clau, DBRef dbr)
|
||||
{ yamop *code_p;
|
||||
{
|
||||
yamop *code_p;
|
||||
|
||||
/* no need to erase what has been erased */
|
||||
if (clau->ClFlags & ErasedMask)
|
||||
@ -3900,7 +3903,7 @@ EraseEntry(DBRef entryref)
|
||||
entryref->Next = NIL;
|
||||
if (!DBREF_IN_USE(entryref)) {
|
||||
ErDBE(entryref);
|
||||
} else if ((entryref->Flags & DBCode && entryref->u.Code)) {
|
||||
} else if ((entryref->Flags & DBCode) && entryref->u.Code) {
|
||||
PrepareToEraseClause(ClauseCodeToClause(entryref->u.Code), entryref);
|
||||
}
|
||||
}
|
||||
|
@ -750,12 +750,11 @@ not(A) :-
|
||||
'$call'(A, _, _,CurMod) :-
|
||||
(
|
||||
% goal_expansion is defined, or
|
||||
'$pred_goal_expansion_on' ->
|
||||
'$expand_call'(A,CurMod)
|
||||
;
|
||||
% this is a meta-predicate
|
||||
'$flags'(A,CurMod,F,_), F /\ 0x200000 =:= 0x200000 ->
|
||||
'$pred_goal_expansion_on' ->
|
||||
'$expand_call'(A,CurMod)
|
||||
% this is a meta-predicate
|
||||
; '$flags'(A,CurMod,F,_), F /\ 0x200000 =:= 0x200000 ->
|
||||
'$expand_call'(A, CurMod)
|
||||
;
|
||||
'$execute0'(A, CurMod)
|
||||
).
|
||||
|
@ -498,7 +498,7 @@ debugging :-
|
||||
CP is '$last_choice_pt',
|
||||
functor(G,F,N),
|
||||
(
|
||||
'$meta_predicate'(F,M,N,_) ->
|
||||
'$meta_predicate'(F,M,N,_) ->
|
||||
'$setflop'(1),
|
||||
'$creep',
|
||||
% I need to use call, otherwise I'll be in trouble if G
|
||||
@ -553,10 +553,10 @@ debugging :-
|
||||
D1 is D0-1.
|
||||
|
||||
'$do_execute_dynamic_clause'(G,M,Clause) :-
|
||||
Clause = (G :- Body),
|
||||
'$check_depth_for_interpreter'(D),
|
||||
('$undefined'('$set_depth_limit'(_),prolog) -> true ; '$set_depth_limit'(D)),
|
||||
CP is '$last_choice_pt',
|
||||
Clause = (G :- Body),
|
||||
( Body = true -> true ; '$call'(Body,CP,Body,M) ).
|
||||
|
||||
'$do_creep_execute'(G,M,Cl) :-
|
||||
|
Reference in New Issue
Block a user