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

@@ -507,7 +507,7 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags)
if (flags & SafePredFlag) {
sz = (CELL)NEXTOP(NEXTOP(NEXTOP(p_code,sbpp),p),l);
} else {
sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),sbpp),e),p),l);
sz = (CELL)NEXTOP(NEXTOP(NEXTOP(NEXTOP(NEXTOP(p_code,e),sbpp),p),p),l);
}
cl = (StaticClause *)Yap_AllocCodeSpace(sz);
if (!cl) {
@@ -544,7 +544,8 @@ Yap_InitCPred(char *Name, unsigned long int Arity, CPredicate code, int flags)
p_code = NEXTOP(p_code,sbpp);
if (!(flags & SafePredFlag)) {
p_code->opc = Yap_opcode(_deallocate);
p_code = NEXTOP(p_code,e);
p_code->u.p.p = pe;
p_code = NEXTOP(p_code,p);
}
p_code->opc = Yap_opcode(_procceed);
p_code->u.p.p = pe;