Skip to content

Commit 592de0f

Browse files
committed
Move IS_ARRAY check to is_op_long_compatible
Test tbd
1 parent 2f221e5 commit 592de0f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Zend/zend_compile.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8158,8 +8158,9 @@ static bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
81588158

81598159
ZEND_API bool zend_is_op_long_compatible(zval *op)
81608160
{
8161-
/* This is handled before */
8162-
ZEND_ASSERT(Z_TYPE_P(op) != IS_ARRAY);
8161+
if (Z_TYPE_P(op) == IS_ARRAY) {
8162+
return false;
8163+
}
81638164

81648165
if (Z_TYPE_P(op) == IS_DOUBLE
81658166
&& !zend_is_long_compatible(Z_DVAL_P(op), zend_dval_to_lval(Z_DVAL_P(op)))) {
@@ -8253,7 +8254,7 @@ static inline bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zva
82538254
ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, zval *op)
82548255
{
82558256
if (opcode == ZEND_BW_NOT) {
8256-
return (Z_TYPE_P(op) <= IS_TRUE || Z_TYPE_P(op) == IS_ARRAY || !zend_is_op_long_compatible(op));
8257+
return (Z_TYPE_P(op) <= IS_TRUE || !zend_is_op_long_compatible(op));
82578258
}
82588259

82598260
return 0;

0 commit comments

Comments
 (0)