Skip to content

Commit 16460eb

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
2 parents 8eeb110 + 14684af commit 16460eb

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Zend/zend_compile.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3426,7 +3426,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
34263426
}
34273427
/* }}} */
34283428

3429-
static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
3429+
static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
34303430
{
34313431
if (EG(assertions) >= 0) {
34323432
znode name_node;
@@ -3469,8 +3469,6 @@ static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *
34693469
result->op_type = IS_CONST;
34703470
ZVAL_TRUE(&result->u.constant);
34713471
}
3472-
3473-
return SUCCESS;
34743472
}
34753473
/* }}} */
34763474

@@ -3693,10 +3691,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
36933691
return FAILURE;
36943692
}
36953693

3696-
if (zend_string_equals_literal(lcname, "assert")) {
3697-
return zend_compile_assert(result, args, lcname, fbc);
3698-
}
3699-
37003694
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
37013695
return FAILURE;
37023696
}
@@ -3805,8 +3799,16 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
38053799
zend_op *opline;
38063800

38073801
lcname = zend_string_tolower(Z_STR_P(name));
3808-
38093802
fbc = zend_hash_find_ptr(CG(function_table), lcname);
3803+
3804+
/* Special assert() handling should apply independently of compiler flags. */
3805+
if (fbc && zend_string_equals_literal(lcname, "assert")) {
3806+
zend_compile_assert(result, zend_ast_get_list(args_ast), lcname, fbc);
3807+
zend_string_release(lcname);
3808+
zval_ptr_dtor(&name_node.u.constant);
3809+
return;
3810+
}
3811+
38103812
if (!fbc
38113813
/* Don't use INIT_FCALL for recursive calls */
38123814
|| (fbc == (zend_function*)CG(active_op_array))

0 commit comments

Comments
 (0)