check for very long wchar_t strings when scanning (obs from Jan Wielemaker).

This commit is contained in:
Costa Vitor 2009-07-15 14:26:56 -05:00
parent a1775fb031
commit 8569aacfe5
1 changed files with 5 additions and 1 deletions

View File

@ -1003,7 +1003,11 @@ Yap_tokenizer(int inp_stream, Term *tposp)
wcharp = NULL;
while (TRUE) {
if (charp + 1024 > (char *)AuxSp) {
if (wcharp && wcharp + 1024 > (wchar_t *)AuxSp) {
Yap_Error_TYPE = OUT_OF_AUXSPACE_ERROR;
Yap_ErrorMessage = "Heap Overflow While Scanning: please increase code space (-h)";
break;
} else if (charp + 1024 > (char *)AuxSp) {
Yap_Error_TYPE = OUT_OF_AUXSPACE_ERROR;
Yap_ErrorMessage = "Heap Overflow While Scanning: please increase code space (-h)";
break;