@@ -808,13 +808,14 @@ static HashTable func_info;
808
808
ZEND_API int zend_func_info_rid = -1 ;
809
809
810
810
static uint32_t get_internal_func_info (
811
- const zend_call_info * call_info , const zend_ssa * ssa , zend_string * lcname ) {
812
- if (call_info -> callee_func -> common .scope ) {
811
+ const zend_call_info * call_info , const zend_ssa * ssa ) {
812
+ zend_function * callee_func = call_info -> callee_func ;
813
+ if (callee_func -> common .scope ) {
813
814
/* This is a method, not a function. */
814
815
return 0 ;
815
816
}
816
817
817
- zval * zv = zend_hash_find_ex (& func_info , lcname , 1 );
818
+ zval * zv = zend_hash_find_ex (& func_info , callee_func -> common . function_name , 1 );
818
819
if (!zv ) {
819
820
return 0 ;
820
821
}
@@ -837,9 +838,7 @@ ZEND_API uint32_t zend_get_func_info(
837
838
* ce_is_instanceof = 0 ;
838
839
839
840
if (callee_func -> type == ZEND_INTERNAL_FUNCTION ) {
840
- zend_string * lcname = Z_STR_P (CRT_CONSTANT_EX (call_info -> caller_op_array , call_info -> caller_init_opline , call_info -> caller_init_opline -> op2 ));
841
-
842
- uint32_t internal_ret = get_internal_func_info (call_info , ssa , lcname );
841
+ uint32_t internal_ret = get_internal_func_info (call_info , ssa );
843
842
#if !ZEND_DEBUG
844
843
if (internal_ret ) {
845
844
return internal_ret ;
@@ -851,14 +850,15 @@ ZEND_API uint32_t zend_get_func_info(
851
850
852
851
#if ZEND_DEBUG
853
852
if (internal_ret ) {
853
+ zend_string * name = callee_func -> common .function_name ;
854
854
/* Check whether the func_info information is a subset of the information we can
855
855
* compute from the specified return type, otherwise it contains redundant types. */
856
856
if (internal_ret & ~ret ) {
857
- fprintf (stderr , "Inaccurate func info for %s()\n" , ZSTR_VAL (lcname ));
857
+ fprintf (stderr , "Inaccurate func info for %s()\n" , ZSTR_VAL (name ));
858
858
}
859
859
/* Check whether the func info is completely redundant with arginfo. */
860
860
if (internal_ret == ret ) {
861
- fprintf (stderr , "Useless func info for %s()\n" , ZSTR_VAL (lcname ));
861
+ fprintf (stderr , "Useless func info for %s()\n" , ZSTR_VAL (name ));
862
862
}
863
863
/* If the return type is not mixed, check that the types match exactly if we exclude
864
864
* RC and array information. */
@@ -868,7 +868,7 @@ ZEND_API uint32_t zend_get_func_info(
868
868
/* Func info may contain "true" types as well as isolated "null" and "false". */
869
869
if (diff && !(diff == MAY_BE_FALSE && (ret & MAY_BE_FALSE ))
870
870
&& (internal_ret_any & ~(MAY_BE_NULL |MAY_BE_FALSE ))) {
871
- fprintf (stderr , "Incorrect func info for %s()\n" , ZSTR_VAL (lcname ));
871
+ fprintf (stderr , "Incorrect func info for %s()\n" , ZSTR_VAL (name ));
872
872
}
873
873
}
874
874
return internal_ret ;
0 commit comments