Messages in this thread | | | Date | Sat, 22 Aug 2020 19:11:01 -0500 | From | Segher Boessenkool <> | Subject | Re: Re:Re : [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero |
| |
On Sun, Aug 23, 2020 at 12:54:33AM +0800, Guohua Zhong wrote: > Yet, I have noticed that there is no checking of 'base' in these functions. > But I am not sure how to check is better.As we know that the result is > undefined when divisor is zero. It maybe good to print error and dump stack. > Let the process to know that the divisor is zero by sending SIGFPE.
That is now what the PowerPC integer divide insns do: they just leave the result undefined (and they can set the overflow flag then, but no one uses that).
Segher
| |