i imagine what happened is your kernel doesn't really do the right thing
on catching the exception.  i think the caught exception should restart
the program *exactly* where it left off, dividing by zero, which will lead
to an infinite loop.  if your kernel skipped the instruction, then the value
of (in my case r) would be whatever the previous value was.  if this is the
statement that initializes r, this could be random trash on the stack.  which
would lead to a mystery exception later on for some value of trash on stack.

- erik
----

this provides the correct result.

#include <u.h>
#include <libc.h>

void
main(void)
{
        double zero, r;

        setfcr(getfcr() & ~FPZDIV);

        zero = 0.;
        r = 1.;
        r = r/zero;
        print("%g\n", r);
        exits("");
}

Reply via email to