@@ -3630,7 +3630,7 @@ int zend_compile_func_cuf(znode *result, zend_ast_list *args, zend_string *lcnam
3630
3630
}
3631
3631
/* }}} */
3632
3632
3633
- static int zend_compile_assert (znode * result , zend_ast_list * args , zend_string * name , zend_function * fbc ) /* {{{ */
3633
+ static void zend_compile_assert (znode * result , zend_ast_list * args , zend_string * name , zend_function * fbc ) /* {{{ */
3634
3634
{
3635
3635
if (EG (assertions ) >= 0 ) {
3636
3636
znode name_node ;
@@ -3673,8 +3673,6 @@ static int zend_compile_assert(znode *result, zend_ast_list *args, zend_string *
3673
3673
result -> op_type = IS_CONST ;
3674
3674
ZVAL_TRUE (& result -> u .constant );
3675
3675
}
3676
-
3677
- return SUCCESS ;
3678
3676
}
3679
3677
/* }}} */
3680
3678
@@ -3882,10 +3880,6 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
3882
3880
return FAILURE ;
3883
3881
}
3884
3882
3885
- if (zend_string_equals_literal (lcname , "assert" )) {
3886
- return zend_compile_assert (result , args , lcname , fbc );
3887
- }
3888
-
3889
3883
if (CG (compiler_options ) & ZEND_COMPILE_NO_BUILTINS ) {
3890
3884
return FAILURE ;
3891
3885
}
@@ -3988,8 +3982,16 @@ void zend_compile_call(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
3988
3982
zend_op * opline ;
3989
3983
3990
3984
lcname = zend_string_tolower (Z_STR_P (name ));
3991
-
3992
3985
fbc = zend_hash_find_ptr (CG (function_table ), lcname );
3986
+
3987
+ /* Special assert() handling should apply independently of compiler flags. */
3988
+ if (fbc && zend_string_equals_literal (lcname , "assert" )) {
3989
+ zend_compile_assert (result , zend_ast_get_list (args_ast ), lcname , fbc );
3990
+ zend_string_release (lcname );
3991
+ zval_ptr_dtor (& name_node .u .constant );
3992
+ return ;
3993
+ }
3994
+
3993
3995
if (!fbc
3994
3996
|| (fbc -> type == ZEND_INTERNAL_FUNCTION && (CG (compiler_options ) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS ))
3995
3997
|| (fbc -> type == ZEND_USER_FUNCTION && (CG (compiler_options ) & ZEND_COMPILE_IGNORE_USER_FUNCTIONS ))
0 commit comments