Re:Re: [PATCH] powerpc: Fix a bug in __div64_32 if divisor is zero

Segher Boessenkool segher at kernel.crashing.org
Sun Aug 23 10:11:01 AEST 2020


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


More information about the Linuxppc-dev mailing list