com php-src: Simpler fix for #74974: Zend/zend_operators.c Zend/zend_portability.h
| From: | Sara Golemon | Date: | Thu, 27 Jul 2017 13:25:38 +0000 |
| Subject: | com php-src: Simpler fix for #74974: Zend/zend_operators.c Zend/zend_portability.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98835@lists.php.net to get a copy of this message | ||
Commit: 34e5d3a87d0b0a01578754b646f50d01a087ba7c
Author: Pedro Magalhães <mail@pmmaga.net> Sun, 23 Jul 2017 14:41:50 +0200
Committer: Sara Golemon <pollita@php.net> Thu, 27 Jul 2017 09:25:38 -0400
Parents: 9fcfe52d03bc40cfce8306debe2e91d83a560683
Branches: PHP-7.0 PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=34e5d3a87d0b0a01578754b646f50d01a087ba7c
Log:
Simpler fix for #74974
Bugs:
https://bugs.php.net/74974
Changed paths:
M Zend/zend_operators.c
M Zend/zend_portability.h
Diff:
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index c6d22fe..3a8929b 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -2151,16 +2151,6 @@ ZEND_API int ZEND_FASTCALL is_not_equal_function(zval *result, zval *op1,
zval *
ZEND_API int ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval *op2) /* {{{ */
{
- if (UNEXPECTED((Z_TYPE_P(op1) == IS_DOUBLE) && zend_isnan(Z_DVAL_P(op1)))) {
- ZVAL_FALSE(result);
- return SUCCESS;
- }
-
- if (UNEXPECTED((Z_TYPE_P(op2) == IS_DOUBLE) && zend_isnan(Z_DVAL_P(op2)))) {
- ZVAL_FALSE(result);
- return SUCCESS;
- }
-
if (compare_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
@@ -2171,16 +2161,6 @@ ZEND_API int ZEND_FASTCALL is_smaller_function(zval *result, zval *op1, zval
*op
ZEND_API int ZEND_FASTCALL is_smaller_or_equal_function(zval *result, zval *op1, zval *op2) /* {{{
*/
{
- if (UNEXPECTED((Z_TYPE_P(op1) == IS_DOUBLE) && isnan(Z_DVAL_P(op1)))) {
- ZVAL_FALSE(result);
- return SUCCESS;
- }
-
- if (UNEXPECTED((Z_TYPE_P(op2) == IS_DOUBLE) && isnan(Z_DVAL_P(op2)))) {
- ZVAL_FALSE(result);
- return SUCCESS;
- }
-
if (compare_function(result, op1, op2) == FAILURE) {
return FAILURE;
}
diff --git a/Zend/zend_portability..h b/Zend/zend_portability.h
index 9914621..b790e0c 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -433,7 +433,7 @@ char *alloca();
#define ZEND_STRL(str) (str), (sizeof(str)-1)
#define ZEND_STRS(str) (str), (sizeof(str))
#define ZEND_NORMALIZE_BOOL(n) \
- ((n) ? (((n)>0) ? 1 : -1) : 0)
+ ((n) ? (((n)<0) ? -1 : 1) : 0)
#define ZEND_TRUTH(x) ((x) ? 1 : 0)
#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))