To my understanding, there isn't a flaw in the Mozilla code. What is
happening is that a cast is made to test if a value inside a double
actually is just an int! If it wasn't, no harm is done and the double
will be continued to be treaten as a double.
That's is how I've interpreted it. To see where the macro in question
(that generates the SIGFPE's) is defined and used, check this link:
http://lxr.mozilla.org/seamonkey/ident?i=JSDOUBLE_IS_INT
Here's the definition:
#define JSDOUBLE_IS_INT(d, i) (JSDOUBLE_IS_FINITE(d) && \
!JSDOUBLE_IS_NEGZERO(d) && ((d) == (i = (jsint)(d))))
(Taken from http://lxr.mozilla.org/seamonkey/source/js/src/jsnum.h#82 )
I'm not 100% sure this is the only place where this happens, but it
seems to be the most frequent. If it actually is the case that the cast
is made just for testing purposes, then there isn't any flaw in the code
and the SIGFPE (here) just needs to be turned off?
I hope someone will object if this is not the case. (Or confirm that
it's ok :))
/Markus
On Tue, Jan 04, 2000 at 12:25:15PM -0800, Ronald F. Guilmette wrote:
>
> In message <[EMAIL PROTECTED]>,
> Martin Cracauer <[EMAIL PROTECTED]> wrote:
>
> >Hence it is good to trap this and it is a bug in Mozilla, period.
> >...
> >I think we might discuss lowing the traps so that the softer
> >exceptions are disabled. But most cases where people cry about
> >FreeBSD's behaviour are serious errors like the one in mozilla, so we
> >won't gain much.
>
> I agree that it appears that the Mozilla code had a serious bug/flaw,
> and that having the FP traps enabled caused that fact to become
> apparent.
>
> But the issue for me is still one of standards conformance. Regardless of
> how helpful enabled FP traps may be, on occasion, for certain programs
> and/or certain programmers, the IEEE 754 standard is pretty darn clear
> and unambiguous regarding what the default setting should be, i.e. all
> traps disabled.
>
>
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-hackers" in the body of the message
>
--
Markus Holmberg | Give me UNIX or give me a typewriter.
[EMAIL PROTECTED] | http://www.freebsd.org/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message