Upgrade to new CHR (with Jan's changes).

Found out I need to add an extra field to allocate so that the
exception handling code knows where the clause is.
Protect creep_allowed from NULL pointers.
This commit is contained in:
Vitor Santos Costa
2008-08-30 16:24:44 +01:00
parent 2ae9677f4b
commit 2a84e259a2
11 changed files with 49 additions and 20 deletions

View File

@@ -517,6 +517,17 @@ a_e(op_numbers opcode, yamop *code_p, int pass_no)
return code_p;
}
inline static yamop *
a_p0(op_numbers opcode, yamop *code_p, int pass_no, PredEntry *p0)
{
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.p.p = p0;
}
GONEXT(p);
return code_p;
}
inline static yamop *
a_ue(op_numbers opcode, op_numbers opcodew, yamop *code_p, int pass_no)
{
@@ -2155,7 +2166,7 @@ a_deallocate(clause_info *clinfo, yamop *code_p, int pass_no, struct intermediat
cip->cpc = cip->cpc->nextInst;
code_p = a_p(_dexecute, clinfo, code_p, pass_no, cip);
} else
code_p = a_e(_deallocate, code_p, pass_no);
code_p = a_p0(_deallocate, code_p, pass_no, cip->CurrentPred);
clinfo->dealloc_found = TRUE;
}
return code_p;
@@ -3682,7 +3693,8 @@ Yap_InitComma(void)
code_p->u.sbpp.bmap = NULL;
GONEXT(sbpp);
code_p->opc = emit_op(_deallocate);
GONEXT(e);
code_p->u.p.p = PredMetaCall;
GONEXT(p);
code_p->opc = emit_op(_procceed);
code_p->u.p.p = PredMetaCall;
GONEXT(p);