stack overflow patches:

process overflows as high-level as possible;
   introduce overflow related errors
   ExpandWorkSpace should never call Error: use ErrorMessage instead,
   format_putc should never release memory, causes memory corruption,
   Linux does not like MAP_FIXED, it can overwrite the actual program
code.
   condor: twick configure to disable readline with condor.
----------------------------------------------------------------------


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@632 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2002-10-10 05:58:49 +00:00
parent 3e662aca31
commit 523fae9544
27 changed files with 502 additions and 170 deletions

View File

@@ -141,8 +141,6 @@ jmp_buf CompilerBotch;
#define IsNewVar(v) (Addr(v)<freep0 || Addr(v)>freep)
static char ErrorSay[80];
inline static void pop_code(void);
inline static void
@@ -2768,15 +2766,13 @@ cclause(Term inp_clause, int NOfArgs, int mod)
Int osize = 2*sizeof(CELL)*(ASP-H);
ARG1 = my_clause;
if (!gc(2, ENV, P)) {
Error_TYPE = SYSTEM_ERROR;
Error_TYPE = OUT_OF_STACK_ERROR;
Error_Term = my_clause;
ErrorMessage = "not enough stack";
}
if (osize > ASP-H) {
if (!growstack(2*sizeof(CELL)*(ASP-H))) {
Error_TYPE = SYSTEM_ERROR;
Error_Term = my_clause;
ErrorMessage = "not enough stack";
}
}
my_clause = ARG1;
@@ -2796,7 +2792,6 @@ cclause(Term inp_clause, int NOfArgs, int mod)
reset_vars();
Error_TYPE = SYSTEM_ERROR;
Error_Term = TermNil;
ErrorMessage = "not enough heap space to compile clause";
return(0);
}
restart_compilation: