cpu-x86: clear the x87 stack when rewinding; fixes math.floats.env failures on Linux

db4
Slava Pestov 2009-09-12 16:59:30 -04:00
parent 699695ba14
commit a456f79f9c
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ DEF(F_FASTCALL void,c_to_factor,(CELL quot)):
ret
DEF(F_FASTCALL void,throw_impl,(CELL quot, F_STACK_FRAME *rewind_to)):
/* clear x87 stack, but preserve rounding mode and exception flags */
sub $2,STACK_REG
fnstcw (STACK_REG)
fninit
fldcw (STACK_REG)
/* rewind_to */
mov ARG1,STACK_REG
jmp *QUOT_XT_OFFSET(ARG0)