diff options
author | Guido van Rossum <guido@python.org> | 1997-03-14 04:23:42 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-03-14 04:23:42 (GMT) |
commit | 1f06beeeddea2abefe6ab10ced35d7c4186f9940 (patch) | |
tree | 36c12af33edfa013494140817ee98b357c920f36 | |
parent | efd3a3a843b15c05696ba4ac8c23b00d9d9a24ce (diff) | |
download | cpython-1f06beeeddea2abefe6ab10ced35d7c4186f9940.zip cpython-1f06beeeddea2abefe6ab10ced35d7c4186f9940.tar.gz cpython-1f06beeeddea2abefe6ab10ced35d7c4186f9940.tar.bz2 |
Change PyFPE_END_PROTECT to PyFPE_END_PROTECT(v). v should be the
last variable to which a floating point expression is assigned. The
macro passes its address to a dummy function so that the optimizer
can't delay calculating its value until after the macro.
-rw-r--r-- | Include/pyfpe.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/pyfpe.h b/Include/pyfpe.h index ef44e66..b2d8fee 100644 --- a/Include/pyfpe.h +++ b/Include/pyfpe.h @@ -131,7 +131,7 @@ extern "C" { #include <math.h> extern jmp_buf PyFPE_jbuf; extern int PyFPE_counter; -extern double PyFPE_dummy(void); +extern double PyFPE_dummy(); #define PyFPE_START_PROTECT(err_string, leave_stmt) \ if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \ @@ -149,12 +149,12 @@ if (!PyFPE_counter++ && setjmp(PyFPE_jbuf)) { \ * which counts down PyFPE_counter, and thereby monkey wrench the overeager * optimizer. Better solutions are welcomed.... */ -#define PyFPE_END_PROTECT PyFPE_counter -= (int)PyFPE_dummy(); +#define PyFPE_END_PROTECT(v) PyFPE_counter -= (int)PyFPE_dummy(&(v)); #else #define PyFPE_START_PROTECT(err_string, leave_stmt) -#define PyFPE_END_PROTECT +#define PyFPE_END_PROTECT(v) #endif |