]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4' into PHP-8.0
authorFelipe Pena <felipe@php.net>
Thu, 25 Feb 2021 20:54:24 +0000 (20:54 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 25 Feb 2021 20:54:24 +0000 (20:54 +0000)
1  2 
ext/reflection/php_reflection.c

index 4debb4c7e6591899145a77c70da725456ab3757f,a358994fd5b81bce1d4bbfb071ea15d4006d1f79..64c5355fc83657fbdb3d10c6f6f170f17c630259
@@@ -2081,11 -2075,16 +2086,15 @@@ ZEND_METHOD(ReflectionGenerator, __cons
        ex = ((zend_generator *) Z_OBJ_P(generator))->execute_data;
        if (!ex) {
                _DO_THROW("Cannot create ReflectionGenerator based on a terminated Generator");
 -              return;
 +              RETURN_THROWS();
        }
  
+       if (intern->ce) {
+               zval_ptr_dtor(&intern->obj);
+       }
        intern->ref_type = REF_TYPE_GENERATOR;
 -      Z_ADDREF_P(generator);
 -      ZVAL_OBJ(&intern->obj, Z_OBJ_P(generator));
 +      ZVAL_OBJ_COPY(&intern->obj, Z_OBJ_P(generator));
        intern->ce = zend_ce_generator;
  }
  /* }}} */