diff --git a/C/cdmgr.c b/C/cdmgr.c index c3b1baf59..715406717 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -866,7 +866,8 @@ addclause(Term t, CODEADDR cp, int mode, int mod) spy_flag = TRUE; if (mode == consult) not_was_reconsulted(p, t, TRUE); - if (Error_TYPE == PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE) + /* always check if we have a valid error first */ + if (ErrorMessage && Error_TYPE == PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE) return; if (!is_dynamic(p)) { Clause *clp = ClauseCodeToClause(cp); diff --git a/C/compiler.c b/C/compiler.c index 68883143a..33de2c5f7 100644 --- a/C/compiler.c +++ b/C/compiler.c @@ -2718,7 +2718,7 @@ cclause(Term inp_clause, int NOfArgs, int mod) /* may botch while doing a different module */ /* first, initialise CompilerBotch to handle all cases of interruptions */ - ErrorMessage = NIL; + ErrorMessage = NULL; if ((botch_why = setjmp(CompilerBotch)) == 3) { /* out of local stack, just duplicate the stack */ restore_machine_regs(); @@ -2759,7 +2759,7 @@ cclause(Term inp_clause, int NOfArgs, int mod) return(0); } restart_compilation: - if (ErrorMessage != NIL) { + if (ErrorMessage != NULL) { reset_vars(); return (0); } diff --git a/C/sysbits.c b/C/sysbits.c index 063d1a4a7..764779c98 100644 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -1111,9 +1111,10 @@ InteractSIGINT(int ch) { unsigned long int heap_space_taken = (unsigned long int)(Unsigned(HeapTop)-Unsigned(HeapBase)); double frag = (100.0*(heap_space_taken-HeapUsed))/heap_space_taken; - YP_fprintf(YP_stderr, "Code Space: %ld (%ld bytes used, fragmentation %.3f%%).\n", - (unsigned long int)(Unsigned (AuxTop) - Unsigned (HeapBase)), - (unsigned long int)(Unsigned(HeapTop)-Unsigned(HeapBase)), + YP_fprintf(YP_stderr, "Code Space: %ld (%ld bytes needed, %ld bytes used, fragmentation %.3f%%).\n", + (unsigned long int)(Unsigned (H0) - Unsigned (HeapBase)), + (unsigned long int)(Unsigned(HeapTop)-Unsigned(HeapBase)), + (unsigned long int)(HeapUsed), frag); YP_fprintf(YP_stderr, "Stack Space: %ld (%ld for Global, %ld for local).\n", (unsigned long int)(sizeof(CELL)*(LCL0-H0)),