fix marking of dead mega clauses */

This commit is contained in:
Vítor Santos Costa 2012-04-23 23:24:35 +01:00
parent cd5e1211c5
commit 5b443bdc46
1 changed files with 4 additions and 5 deletions

View File

@ -572,17 +572,16 @@ RestoreMegaClause(MegaClause *cl USES_REGS)
* clause for this predicate or not * clause for this predicate or not
*/ */
{ {
UInt ncls, i; yamop *ptr, *max, *nextptr;
yamop *ptr;
cl->ClPred = PtoPredAdjust(cl->ClPred); cl->ClPred = PtoPredAdjust(cl->ClPred);
if (cl->ClNext) { if (cl->ClNext) {
cl->ClNext = (MegaClause *)AddrAdjust((ADDR)(cl->ClNext)); cl->ClNext = (MegaClause *)AddrAdjust((ADDR)(cl->ClNext));
} }
ncls = cl->ClPred->cs.p_code.NOfClauses; max = (yamop *)((CODEADDR)cl+cl->ClSize);
for (i = 0, ptr = cl->ClCode; i < ncls; i++) { for (ptr = cl->ClCode; ptr < max; ) {
yamop *nextptr = (yamop *)((char *)ptr + cl->ClItemSize); nextptr = (yamop *)((char *)ptr + cl->ClItemSize);
restore_opcodes(ptr, nextptr PASS_REGS); restore_opcodes(ptr, nextptr PASS_REGS);
ptr = nextptr; ptr = nextptr;
} }