Skip to content

Commit 46d38aa

Browse files
committed
Merge branch 'PHP-7.4'
2 parents eeb7511 + 16460eb commit 46d38aa

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
@@ -3424,7 +3424,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
34243424
}
34253425
/* }}} */
34263426

3427-
static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
3427+
static void zend_compile_assert(znode *result, zend_ast_list *args, zend_string *name, zend_function *fbc) /* {{{ */
34283428
{
34293429
if (EG(assertions) >= 0) {
34303430
znode name_node;
@@ -3467,8 +3467,6 @@ static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *
34673467
result->op_type = IS_CONST;
34683468
ZVAL_TRUE(&result->u.constant);
34693469
}
3470-
3471-
return SUCCESS;
34723470
}
34733471
/* }}} */
34743472

@@ -3691,10 +3689,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
36913689
return FAILURE;
36923690
}
36933691

3694-
if (zend_string_equals_literal(lcname, "assert")) {
3695-
return zend_compile_assert(result, args, lcname, fbc);
3696-
}
3697-
36983692
if (CG(compiler_options) & ZEND_COMPILE_NO_BUILTINS) {
36993693
return FAILURE;
37003694
}
@@ -3803,8 +3797,16 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
38033797
zend_op *opline;
38043798

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

0 commit comments

Comments
 (0)