fix bug in following retry chains.

This commit is contained in:
Vitor Santos Costa 2009-03-17 20:10:14 +00:00
parent 4fa27164e6
commit a221244b8c
1 changed files with 30 additions and 2 deletions

View File

@ -2130,8 +2130,6 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
break;
case _try_logical:
case _retry_logical:
case _count_retry_logical:
case _profiled_retry_logical:
{
/* find out who owns this sequence of try-retry-trust */
/* I don't like this code, it's a bad idea to do a linear scan,
@ -2146,6 +2144,36 @@ mark_choicepoints(register choiceptr gc_B, tr_fr_ptr saved_TR, int very_verbose)
/* mark timestamp */
nargs = rtp->u.OtaLl.s+1;
break;
case _count_retry_logical:
{
/* find out who owns this sequence of try-retry-trust */
/* I don't like this code, it's a bad idea to do a linear scan,
on the other hand it's the only way we can be sure we can reclaim
space
*/
yamop *end = rtp->u.lld.n;
while (Yap_op_from_opcode(end->opc) != _count_trust_logical)
end = end->u.lld.n;
mark_ref_in_use((DBRef)end->u.lld.t.block);
}
/* mark timestamp */
nargs = rtp->u.lld.t.s+1;
break;
case _profiled_retry_logical:
{
/* find out who owns this sequence of try-retry-trust */
/* I don't like this code, it's a bad idea to do a linear scan,
on the other hand it's the only way we can be sure we can reclaim
space
*/
yamop *end = rtp->u.lld.n;
while (Yap_op_from_opcode(end->opc) != _profiled_trust_logical)
end = end->u.lld.n;
mark_ref_in_use((DBRef)end->u.lld.t.block);
}
/* mark timestamp */
nargs = rtp->u.lld.t.s+1;
break;
case _trust_logical:
case _count_trust_logical:
case _profiled_trust_logical: