Skip to content

Commit 83e5547

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fix for failing tests. gcc 4.8.3 would optimize away the assigment.
2 parents 76d6c4f + aa192f5 commit 83e5547

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/mysqlnd/mysqlnd_ps_codec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
195195
#ifdef HAVE_DECIMAL_FP_SUPPORT
196196
{
197197
typedef float dec32 __attribute__((mode(SD)));
198-
dec32 d32val = fval;
198+
/* volatile so the compiler will not optimize away the conversion */
199+
volatile dec32 d32val = fval;
199200

200201
/* The following cast is guaranteed to do the right thing */
201202
dval = (double) d32val;

0 commit comments

Comments
 (0)