com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_o perators.h
| From: | Ard Biesheuvel | Date: | Wed, 11 Dec 2013 07:50:53 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_o perators.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74369@lists.php.net to get a copy of this message | ||
Commit: bec62af14145c4c636716fc54465fc2f8c5d00b4
Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> Wed, 11 Dec 2013 08:50:53 +0100
Parents: 41cd53329871cb99799cd9a8f76151312be2e960 8f1fee61e2f0c24fd46d0ecbc6ded5c68bae7d6e
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bec62af14145c4c636716fc54465fc2f8c5d00b4
Log:
Merge branch 'PHP-5.4' into PHP-5.5
Changed paths:
MM Zend/zend_operators.h
Diff:
diff --cc Zend/zend_operators.h
index 6e52de0,815ef27..815cf58
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@@ -632,18 -588,19 +632,22 @@@ static zend_always_inline int fast_add_
"fstpl (%0)\n"
"1:"
:
- : "r"(result),
- "r"(op1),
- "r"(op2)
- : "rax");
+ : "r"(&result->value),
+ "r"(&op1->value),
+ "r"(&op2->value),
+ "n"(IS_LONG),
+ "n"(IS_DOUBLE),
+ "n"(ZVAL_OFFSETOF_TYPE)
+ : "rax","cc");
#else
- Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2);
+ /*
+ * 'result' may alias with op1 or op2, so we need to
+ * ensure that 'result' is not updated until after we
+ * have read the values of op1 and op2.
+ */
if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
- && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) {
+ && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != ((Z_LVAL_P(op1) + Z_LVAL_P(op2)) &
LONG_SIGN_MASK))) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
Z_TYPE_P(result) = IS_DOUBLE;
} else {