mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed crash in Zend/tests/bug69891.phpt on x86 (32-bit).
compare_function() now has to be compatible with binary_op_type (use fastcall convention). Introduced new zval_compare_function() to be used as zval comparison callback instead of compare_function().
This commit is contained in:
parent
0da4c34f0e
commit
b97df475df
3 changed files with 16 additions and 3 deletions
|
@ -1760,7 +1760,7 @@ static inline void zend_free_obj_get_result(zval *op) /* {{{ */
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
static zend_always_inline int i_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
{
|
||||
int ret;
|
||||
int converted = 0;
|
||||
|
@ -1942,6 +1942,18 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
{
|
||||
return i_compare_function(result, op1, op2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API int zval_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
|
||||
{
|
||||
return i_compare_function(result, op1, op2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int hash_zval_identical_function(zval *z1, zval *z2) /* {{{ */
|
||||
{
|
||||
zval result;
|
||||
|
|
|
@ -327,7 +327,8 @@ again:
|
|||
return result;
|
||||
}
|
||||
|
||||
ZEND_API int compare_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int zval_compare_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive);
|
||||
ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2);
|
||||
|
|
|
@ -164,7 +164,7 @@ static void php_set_compare_func(zend_long sort_type) /* {{{ */
|
|||
|
||||
case PHP_SORT_REGULAR:
|
||||
default:
|
||||
ARRAYG(compare_func) = compare_function;
|
||||
ARRAYG(compare_func) = zval_compare_function;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue