From 4d4516f8481011abef9f6c919a9a1dd5a73b31f8 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 12 Feb 2003 14:02:42 +0000 Subject: [PATCH] >Code should be initialised in recordp and record_stat_p git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@770 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/dbase.c | 7 ++++--- C/tracer.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/C/dbase.c b/C/dbase.c index 34921f301..ace14141a 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -1631,7 +1631,7 @@ record(int Flag, Term key, Term t_data, Term t_code) x->Prev = p->Last; p->Last = x; } - if (Flag & WithRef) { + if (Flag & MkCode) { x->Code = (yamop *) IntegerOfTerm(t_code); } WRITE_UNLOCK(p->DBRWLock); @@ -3804,7 +3804,8 @@ PrepareToEraseClause(Clause *clau, DBRef dbr) WRITE_LOCK(pred->PRWLock); /* got my pred entry, let's have some fun! */ clau_code = clau->ClCode; - if (pred->cs.p_code.FirstClause == pred->cs.p_code.LastClause) { + if (pred->cs.p_code.FirstClause == pred->cs.p_code.LastClause && + pred->cs.p_code.FirstClause != NULL) { #ifdef DEBUG if (pred->cs.p_code.FirstClause != clau_code) { /* sanity check */ @@ -3819,7 +3820,7 @@ PrepareToEraseClause(Clause *clau, DBRef dbr) #endif /* nothing left here, let's clean the shop */ Yap_FreeCodeSpace(((char *) ClauseCodeToClause(pred->CodeOfPred))); - pred->cs.p_code.LastClause = pred->cs.p_code.FirstClause = NIL; + pred->cs.p_code.LastClause = pred->cs.p_code.FirstClause = NULL; pred->OpcodeOfPred = FAIL_OPCODE; pred->cs.p_code.TrueCodeOfPred = pred->CodeOfPred = (yamop *)(&(pred->OpcodeOfPred)); diff --git a/C/tracer.c b/C/tracer.c index d403522fc..101a057e1 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -113,8 +113,8 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) vsc_count++; /* return;*/ #ifdef COMMENTED - if (vsc_count < 414040LL) return; - if (vsc_count == 414140LL) { + if (vsc_count < 124840LL) return; + if (vsc_count == 124881LL) { printf("Here I go\n"); } if (vsc_count > 500000) exit(0);