@@ -3658,7 +3658,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
3658
3658
}
3659
3659
/* }}} */
3660
3660
3661
- static int zend_compile_assert (znode * result , zend_ast_list * args , zend_string * name , zend_function * fbc ) /* {{{ */
3661
+ static void zend_compile_assert (znode * result , zend_ast_list * args , zend_string * name , zend_function * fbc ) /* {{{ */
3662
3662
{
3663
3663
if (EG (assertions ) >= 0 ) {
3664
3664
znode name_node ;
@@ -3701,8 +3701,6 @@ static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *
3701
3701
result -> op_type = IS_CONST ;
3702
3702
ZVAL_TRUE (& result -> u .constant );
3703
3703
}
3704
-
3705
- return SUCCESS ;
3706
3704
}
3707
3705
/* }}} */
3708
3706
@@ -3909,10 +3907,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
3909
3907
return FAILURE ;
3910
3908
}
3911
3909
3912
- if (zend_string_equals_literal (lcname , "assert" )) {
3913
- return zend_compile_assert (result , args , lcname , fbc );
3914
- }
3915
-
3916
3910
if (CG (compiler_options ) & ZEND_COMPILE_NO_BUILTINS ) {
3917
3911
return FAILURE ;
3918
3912
}
@@ -4015,8 +4009,16 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
4015
4009
zend_op * opline ;
4016
4010
4017
4011
lcname = zend_string_tolower (Z_STR_P (name ));
4018
-
4019
4012
fbc = zend_hash_find_ptr (CG (function_table ), lcname );
4013
+
4014
+ /* Special assert() handling should apply independently of compiler flags. */
4015
+ if (fbc && zend_string_equals_literal (lcname , "assert" )) {
4016
+ zend_compile_assert (result , zend_ast_get_list (args_ast ), lcname , fbc );
4017
+ zend_string_release (lcname );
4018
+ zval_ptr_dtor (& name_node .u .constant );
4019
+ return ;
4020
+ }
4021
+
4020
4022
if (!fbc
4021
4023
|| (fbc -> type == ZEND_INTERNAL_FUNCTION && (CG (compiler_options ) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS ))
4022
4024
|| (fbc -> type == ZEND_USER_FUNCTION && (CG (compiler_options ) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS ))
0 commit comments