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:
8
C/init.c
8
C/init.c
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user