fix multi-file preds defined in Prolog mode to be actuall defined in that mode.

This commit is contained in:
Vitor Santos Costa 2011-09-07 08:02:54 +02:00
parent 04f0a4bb73
commit db0a7771ba

View File

@ -2136,9 +2136,9 @@ addclause(Term t, yamop *cp, int mode, Term mod, Term *t4ref)
PELOCK(20,p);
pflags = p->PredFlags;
/* we are redefining a prolog module predicate */
if ((pflags & (UserCPredFlag|CArgsPredFlag|NumberDBPredFlag|AtomDBPredFlag|TestPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)) ||
(p->ModuleOfPred == PROLOG_MODULE &&
mod != TermProlog && mod) ) {
if ((pflags &
(UserCPredFlag|CArgsPredFlag|NumberDBPredFlag|AtomDBPredFlag|TestPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)) ||
(p->ModuleOfPred == PROLOG_MODULE && mod != TermProlog && mod && !(p->PredFlags & (DynamicPredFlag|LogUpdatePredFlag|MultiFileFlag)))) {
addcl_permission_error(RepAtom(at), Arity, FALSE);
UNLOCKPE(30,p);
return TermNil;
@ -2884,8 +2884,6 @@ p_new_multifile( USES_REGS1 )
pe = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, arity),mod));
PELOCK(26,pe);
pe->PredFlags |= MultiFileFlag;
if (pe->ModuleOfPred == PROLOG_MODULE)
pe->ModuleOfPred = TermProlog;
if (!(pe->PredFlags & (DynamicPredFlag|LogUpdatePredFlag))) {
/* static */
pe->PredFlags |= (SourcePredFlag|CompiledPredFlag);