support access through instance/2

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@899 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2003-10-14 20:48:57 +00:00
parent 514ef300e3
commit a32d37c753

View File

@ -3998,9 +3998,18 @@ p_instance(void)
Term t1 = Deref(ARG1);
DBRef dbr;
if (IsVarTerm(t1) || !IsDBRefTerm(t1))
return (FALSE);
dbr = DBRefOfTerm(t1);
if (IsVarTerm(t1) || !IsDBRefTerm(t1)) {
if (IsIntegerTerm(t1))
dbr = (DBRef)IntegerOfTerm(t1);
else
return (FALSE);
/* limited sanity checking */
if (dbr->id != FunctorDBRef) {
return FALSE;
}
} else {
dbr = DBRefOfTerm(t1);
}
if (dbr->Flags & LogUpdMask) {
op_numbers opc;
LogUpdClause *cl = (LogUpdClause *)dbr;
@ -4041,9 +4050,18 @@ p_instance_module(void)
Term t1 = Deref(ARG1);
DBRef dbr;
if (IsVarTerm(t1) || !IsDBRefTerm(t1))
return (FALSE);
dbr = DBRefOfTerm(t1);
if (IsVarTerm(t1) || !IsDBRefTerm(t1)) {
if (IsIntegerTerm(t1))
dbr = (DBRef)IntegerOfTerm(t1);
else
return (FALSE);
/* limited sanity checking */
if (dbr->id != FunctorDBRef) {
return FALSE;
}
} else {
dbr = DBRefOfTerm(t1);
}
if (dbr->Flags & LogUpdMask) {
LogUpdClause *cl = (LogUpdClause *)dbr;