fix situation where we might assume nonextsing double initialisation of C predicates (use

Hidden Pred Flag).
$host_type was double initialised.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1177 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2004-11-18 22:32:40 +00:00
parent 481d9d38fb
commit 8d2cb067ec
32 changed files with 335 additions and 313 deletions

View File

@@ -459,7 +459,7 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags)
{
Atom atom = Yap_FullLookupAtom(Name);
PredEntry *pe;
yamop *p_code = ((StaticClause *)NULL)->ClCode;
yamop *p_code;
StaticClause *cl = NULL;
if (Arity)
@@ -469,14 +469,12 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags)
if (pe->PredFlags & CPredFlag) {
/* already exists */
cl = ClauseCodeToStaticClause(pe->CodeOfPred);
if ((flags & SafePredFlag) &&
!(pe->PredFlags & SafePredFlag)) {
if ((flags | StandardPredFlag | CPredFlag) != pe->PredFlags) {
Yap_FreeCodeSpace((ADDR)cl);
cl = NULL;
} else {
p_code = cl->ClCode;
}
}
p_code = cl->ClCode;
while (!cl) {
UInt sz;