]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 23 Mar 2020 12:59:22 +0000 (13:59 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 23 Mar 2020 12:59:22 +0000 (13:59 +0100)
* PHP-7.4:
  Fix #79393: Null coalescing operator failing with SplFixedArray

1  2 
ext/spl/spl_fixedarray.c

index 099398de6a58a725aba74cebbb8d7c535e6f1c9e,bceaf2be93daf3fa6a644d269048bc664867ac10..ce3cd2635e420a5910effef995dca4b55b3ed47b
@@@ -333,25 -337,16 +333,16 @@@ static inline zval *spl_fixedarray_obje
  }
  /* }}} */
  
 -static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int check_empty);
++static int spl_fixedarray_object_has_dimension(zend_object *object, zval *offset, int check_empty);
 -static zval *spl_fixedarray_object_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
 +static zval *spl_fixedarray_object_read_dimension(zend_object *object, zval *offset, int type, zval *rv) /* {{{ */
  {
        spl_fixedarray_object *intern;
  
 -      intern = Z_SPLFIXEDARRAY_P(object);
 +      intern = spl_fixed_array_from_obj(object);
  
-       if (type == BP_VAR_IS && intern->fptr_offset_has) {
-               SEPARATE_ARG_IF_REF(offset);
-               zend_call_method_with_1_params(object, intern->std.ce, &intern->fptr_offset_has, "offsetexists", rv, offset);
-               if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
-                       zval_ptr_dtor(offset);
-                       return NULL;
-               }
-               if (!i_zend_is_true(rv)) {
-                       zval_ptr_dtor(offset);
-                       zval_ptr_dtor(rv);
-                       return &EG(uninitialized_zval);
-               }
-               zval_ptr_dtor(rv);
+       if (type == BP_VAR_IS && !spl_fixedarray_object_has_dimension(object, offset, 0)) {
+               return &EG(uninitialized_zval);
        }
  
        if (intern->fptr_offset_get) {