fix bug in handling very many comments.

This commit is contained in:
Vítor Santos Costa 2011-05-24 12:26:37 +01:00
parent b3bd547f55
commit a57cd039d8
1 changed files with 18 additions and 0 deletions

View File

@ -855,6 +855,15 @@ Yap_tokenizer(IOSTREAM *inp_stream, Term *tposp)
while (chtype(ch) == BS) {
ch = getchr(inp_stream);
}
if (ASP-H < 1024) {
Yap_ErrorMessage = "Stack Overflow";
Yap_Error_TYPE = OUT_OF_STACK_ERROR;
Yap_Error_Size = 0L;
if (p)
p->Tok = Ord(kind = eot_tok);
/* serious error now */
return l;
}
*tposp = Yap_StreamPosition(inp_stream);
}
goto restart;
@ -1162,6 +1171,15 @@ Yap_tokenizer(IOSTREAM *inp_stream, Term *tposp)
while (chtype(ch) == BS) {
ch = getchr(inp_stream);
}
if (ASP-H < 1024) {
Yap_ErrorMessage = "Stack Overflow";
Yap_Error_TYPE = OUT_OF_STACK_ERROR;
Yap_Error_Size = 0L;
if (p)
p->Tok = Ord(kind = eot_tok);
/* serious error now */
return l;
}
*tposp = Yap_StreamPosition(inp_stream);
}
goto restart;