From: Matt Birkholz Date: Tue, 6 May 2014 02:26:44 +0000 (-0700) Subject: Fix continue_from_trap to NOT open a FREE_PARANOIA_MARGIN hole. X-Git-Tag: release-9.2.0~11 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2197dfd15065260002b55a8ea746196ba22ad094;p=mit-scheme.git Fix continue_from_trap to NOT open a FREE_PARANOIA_MARGIN hole. Just reset Free to heap_alloc_limit if its sanity check fails. --- diff --git a/src/microcode/uxtrap.c b/src/microcode/uxtrap.c index d1eb80767..bf9d45636 100644 --- a/src/microcode/uxtrap.c +++ b/src/microcode/uxtrap.c @@ -329,7 +329,6 @@ trap_handler (const char * message, display more information. */ #define SCHEME_ALIGNMENT_MASK ((sizeof (SCHEME_OBJECT)) - 1) -#define FREE_PARANOIA_MARGIN 0x100 #define ALIGNED_P(addr) \ ((((unsigned long) (addr)) & SCHEME_ALIGNMENT_MASK) == 0) @@ -405,19 +404,16 @@ continue_from_trap (int signo, SIGINFO_T info, SIGCONTEXT_T * scp) new_sp = 0; /* Sanity-check Free. */ - if ((new_sp != 0) - && (ADDRESS_IN_HEAP_P (Free)) - && (ALIGNED_P (Free))) + if (!((new_sp != 0) + && (ADDRESS_IN_HEAP_P (Free)) + && (ALIGNED_P (Free)))) { - if (FREE_OK_P (Free)) - { - Free += FREE_PARANOIA_MARGIN; - if (!FREE_OK_P (Free)) - Free = heap_alloc_limit; - } +#ifdef ENABLE_DEBUGGING_TOOLS + outf_error ("Resetting bogus Free in continue_from_trap.\n"); + outf_flush_error (); +#endif + Free = heap_alloc_limit; } - else - Free = heap_alloc_limit; /* Encode the registers. */ (recovery_info . extra_trap_info) =