From: Chris Hanson Date: Sun, 26 Feb 1995 03:34:36 +0000 (+0000) Subject: Guarantee that the floating-point register stack is empty when moving X-Git-Tag: 20090517-FFI~6597 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=3c26beac30212aee55ae880ad4f73fefa78f17ab;p=mit-scheme.git Guarantee that the floating-point register stack is empty when moving from C to Scheme and vice-versa. This appears to fix a floating-point stack overflow exception that has been observed under unix and OS/2. --- diff --git a/v7/src/microcode/cmpauxmd/i386.m4 b/v7/src/microcode/cmpauxmd/i386.m4 index 012d138c3..72e04715a 100644 --- a/v7/src/microcode/cmpauxmd/i386.m4 +++ b/v7/src/microcode/cmpauxmd/i386.m4 @@ -1,6 +1,6 @@ ### -*-Midas-*- ### -### $Id: i386.m4,v 1.35 1995/01/06 17:39:39 cph Exp $ +### $Id: i386.m4,v 1.36 1995/02/26 03:34:36 cph Exp $ ### ### Copyright (c) 1992-95 Massachusetts Institute of Technology ### @@ -518,6 +518,18 @@ IFOS2(` OP(pop,l) REG(eax) # Pop struct return into registers jmp IJMP(REG(eax)) # Invoke handler define_c_label(interface_to_scheme) +IF387(` + OP(cmp,l) TW(IMM(0),EDR(i387_presence)) + je interface_to_scheme_proceed + ffree ST(0) # Free floating "regs" + ffree ST(1) + ffree ST(2) + ffree ST(3) + ffree ST(4) + ffree ST(5) + ffree ST(6) + ffree ST(7) +interface_to_scheme_proceed:') ifdef(`WINNT', ` mov edi,_Free ; Free pointer = %edi sub edi,_winnt_address_delta ; as a scheme offset @@ -582,6 +594,7 @@ IF387(` ffree ST(4) ffree ST(5) ffree ST(6) + ffree ST(7) interface_to_C_proceed:') OP(mov,l) TW(REG(edx),REG(eax)) # Set up result