fix saving of source of static clauses.
This commit is contained in:
parent
26e3f2cea0
commit
1cd3777a45
14
H/rheap.h
14
H/rheap.h
@ -547,10 +547,16 @@ RestoreStaticClause(StaticClause *cl USES_REGS)
|
|||||||
* clause for this predicate or not
|
* clause for this predicate or not
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
if (cl->ClFlags & FactMask) {
|
if (cl->usc.ClSource) {
|
||||||
cl->usc.ClPred = PtoPredAdjust(cl->usc.ClPred);
|
char *x = (char *)DBTermAdjust(cl->usc.ClSource);
|
||||||
} else {
|
char *base = (char *)cl;
|
||||||
cl->usc.ClSource = DBTermAdjust(cl->usc.ClSource);
|
|
||||||
|
if (x < base || x > base+cl->ClSize) {
|
||||||
|
cl->usc.ClPred = PtoPredAdjust(cl->usc.ClPred);
|
||||||
|
} else {
|
||||||
|
cl->usc.ClSource = DBTermAdjust(cl->usc.ClSource);
|
||||||
|
RestoreDBTerm(cl->usc.ClSource, TRUE PASS_REGS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (cl->ClNext) {
|
if (cl->ClNext) {
|
||||||
cl->ClNext = PtoStCAdjust(cl->ClNext);
|
cl->ClNext = PtoStCAdjust(cl->ClNext);
|
||||||
|
Reference in New Issue
Block a user