don't give up if you don't have enough space to expand the consult stack.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@390 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-02-27 02:10:01 +00:00
parent 499adf4cf4
commit ec2e474e5c
1 changed files with 5 additions and 4 deletions

View File

@ -715,10 +715,11 @@ static void expand_consult(void)
/* now double consult capacity */
ConsultCapacity += InitialConsultCapacity;
/* I assume it always works ;-) */
new_cl = (consult_obj *)AllocCodeSpace(sizeof(consult_obj)*ConsultCapacity);
if (new_cl == NULL) {
Error(SYSTEM_ERROR,TermNil,"Could not expand consult space: Heap crashed against Stacks");
return;
while ((new_cl = (consult_obj *)AllocCodeSpace(sizeof(consult_obj)*ConsultCapacity)) == NULL) {
if (!growheap(FALSE)) {
Error(SYSTEM_ERROR,TermNil,"Could not expand consult space: Heap crashed against Stacks");
return;
}
}
new_cs = new_cl + (InitialConsultCapacity+1);
new_cb = new_cs + (ConsultBase-ConsultSp);