diff --git a/C/iopreds.c b/C/iopreds.c index 043cea1b1..851bd9d30 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -3073,6 +3073,11 @@ static Int if (!Yap_ExpandPreAllocCodeSpace(0, NULL)) { return FALSE; } + } else if (Yap_Error_TYPE == OUT_OF_HEAP_ERROR) { + Yap_Error_TYPE = YAP_NO_ERROR; + if (!Yap_growheap(FALSE, 0, NULL)) { + return FALSE; + } } else if (Yap_Error_TYPE == OUT_OF_STACK_ERROR) { Yap_Error_TYPE = YAP_NO_ERROR; if (!Yap_gc(nargs, ENV, CP)) { @@ -4142,7 +4147,7 @@ format(volatile Term otail, volatile Term oargs, int sno) if (IsIntegerTerm(t)) { Int il = IntegerOfTerm(t); #if HAVE_SNPRINTF - snprintf(tmp1, 256, "%ld", il); + snprintf(tmp1, 256, "%ld", (long int)il); #else sprintf(tmp1, "%ld", (long int)il); #endif diff --git a/C/scanner.c b/C/scanner.c index aa4d80259..8782d67f8 100644 --- a/C/scanner.c +++ b/C/scanner.c @@ -752,6 +752,7 @@ Yap_tokenizer(int inp_stream) /* huge atom or variable, we are in trouble */ Yap_ErrorMessage = "Code Space Overflow due to huge atom"; Yap_Error_TYPE = OUT_OF_AUXSPACE_ERROR; + Yap_ReleasePreAllocCodeSpace((CODEADDR)TokImage); if (p) p->Tok = Ord(kind = eot_tok); /* serious error now */ @@ -764,6 +765,7 @@ Yap_tokenizer(int inp_stream) /* don't do this in iso */ Atom ae = Yap_LookupAtom(TokImage); if (ae == NIL) { + Yap_Error_TYPE = OUT_OF_HEAP_ERROR; Yap_ErrorMessage = "Code Space Overflow"; if (p) t->Tok = Ord(kind = eot_tok); diff --git a/changes-5.1.html b/changes-5.1.html index 727b51020..f8e42c5d0 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -16,6 +16,8 @@

Yap-5.1.0: