From b65681fe8245bd6e145a59ebb176d7ba9efe2a1c Mon Sep 17 00:00:00 2001 From: vsc Date: Sat, 14 Feb 2004 00:41:12 +0000 Subject: [PATCH] fix back tracer. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@989 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/dbase.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C/dbase.c b/C/dbase.c index 6154213df..a3182cc17 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -4669,7 +4669,7 @@ p_init_queue(void) while ((dbq = (db_queue *)AllocDBSpace(sizeof(db_queue))) == NULL) { if (!Yap_growheap(FALSE, sizeof(db_queue), NULL)) { - Yap_Error(SYSTEM_ERROR, TermNil, Yap_ErrorMessage); + Yap_Error(OUT_OF_HEAP_ERROR, TermNil, "in findall"); return(FALSE); } } @@ -4697,9 +4697,11 @@ p_enqueue(void) return(FALSE); } else father_key = (db_queue *)DBRefOfTerm(Father); - if ((x = (QueueEntry *)AllocDBSpace(sizeof(QueueEntry))) == NULL) { - Yap_Error(OUT_OF_STACK_ERROR, TermNil, "in findall"); - return FALSE; + while ((x = (QueueEntry *)AllocDBSpace(sizeof(QueueEntry))) == NULL) { + if (!Yap_growheap(FALSE, sizeof(QueueEntry), NULL)) { + Yap_Error(OUT_OF_HEAP_ERROR, TermNil, "in findall"); + return FALSE; + } } x->DBT = StoreTermInDB(Deref(ARG2), 2); if (x->DBT == NULL)