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