Dag Sverre Seljebotn wrote:
> usually with overflows one just gets the overflowed value
> silently. With division overflow one crashes the application, which is
> IMO much worse even if it is a very rare corner case.
>
> I think we should raise OverflowError here under the same circumstances
> as ZeroDivisionError.

+1, this matches the patch Lisandro provided.

BTW, isn't there a way to catch these signals in a way that would allow us
to raise an exception instead? Catching signals isn't the hard part, I
guess, but we'd have to extract the current state and code position from
the signal handler, so that we can jump back to the right label and
continue.

As long as they don't occur, signals are a lot cheaper than doing runtime
checks all over the place.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to