@@ -3426,7 +3426,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
3426
3426
}
3427
3427
/* }}} */
3428
3428
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 ) /* {{{ */
3430
3430
{
3431
3431
if (EG (assertions ) >= 0 ) {
3432
3432
znode name_node ;
@@ -3469,8 +3469,6 @@ static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *
3469
3469
result -> op_type = IS_CONST ;
3470
3470
ZVAL_TRUE (& result -> u .constant );
3471
3471
}
3472
-
3473
- return SUCCESS ;
3474
3472
}
3475
3473
/* }}} */
3476
3474
@@ -3693,10 +3691,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
3693
3691
return FAILURE ;
3694
3692
}
3695
3693
3696
- if (zend_string_equals_literal (lcname , "assert" )) {
3697
- return zend_compile_assert (result , args , lcname , fbc );
3698
- }
3699
-
3700
3694
if (CG (compiler_options ) & ZEND_COMPILE_NO_BUILTINS ) {
3701
3695
return FAILURE ;
3702
3696
}
@@ -3805,8 +3799,16 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
3805
3799
zend_op * opline ;
3806
3800
3807
3801
lcname = zend_string_tolower (Z_STR_P (name ));
3808
-
3809
3802
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
+
3810
3812
if (!fbc
3811
3813
/* Don't use INIT_FCALL for recursive calls */
3812
3814
|| (fbc == (zend_function * )CG (active_op_array ))
0 commit comments