www.delorie.com/djgpp/bugs/show.cgi | search |
ldexp() has a bug which cases the numeric coprocessor stack to overflow if called several times. The bug can be traced down to src/libm/src/s_scalb.s: It loads two operands, but leaves one of them on the stack: fild [esp+12] fldq [esp+4] fscale ret Some other math functions use this routine and can crash under quite rare circumstances.
Change djgpp/src/libm/src/s_scalbn.S to: ENTRY(scalbn) fidl 12(%esp) fldl 4(%esp) fscale fxch %st(1) fincstp ret and rebuild libm.a
webmaster | delorie software privacy |
Copyright © 2010 by DJ Delorie | Updated Jul 2010 |