[Python-checkins] r63366 - in python/trunk: Misc/NEWS Modules/cmathmodule.c

Amaury Forgeot d'Arc amauryfa at gmail.com
Fri May 16 13:18:51 CEST 2008


Hello Christian,

> Modified: python/trunk/Modules/cmathmodule.c
> ==============================================================================
> --- python/trunk/Modules/cmathmodule.c	(original)
> +++ python/trunk/Modules/cmathmodule.c	Fri May 16 12:23:31 2008
> @@ -920,7 +920,7 @@
>  	errno = 0;
>  	PyFPE_START_PROTECT("arg function", return 0)
> 	phi = c_atan2(z);
> -	PyFPE_END_PROTECT(r)
> +	PyFPE_END_PROTECT(z)
>  	if (errno != 0)
>  		return math_error();
>  	else

In Include/pyfpe.h, it is suggested that the argument of PyFPE_END_PROTECT
should be *result* of the unsafe operation, or the code optimizer may move the
PyFPE_END_PROTECT call before the operation.

Following this, I think that
	PyFPE_END_PROTECT(phi)
is more correct.

-- 
Amaury Forgeot d'Arc


More information about the Python-checkins mailing list