]> granicus.if.org Git - php/commitdiff
Fix build
authorKalle Sommer Nielsen <kalle@php.net>
Thu, 17 Mar 2016 02:41:36 +0000 (03:41 +0100)
committerKalle Sommer Nielsen <kalle@php.net>
Thu, 17 Mar 2016 02:41:36 +0000 (03:41 +0100)
Zend/zend_generators.c

index 9633fc4f2dc2550f11e401da8d2924df7ea47428..5a3e84ccd1968e31bc4938207023339bf7e88c71 100644 (file)
@@ -386,6 +386,8 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
 
 static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
 {
+       zend_execute_data *original_execute_data = EG(current_execute_data);
+
        /* if we don't stop an array/iterator yield from, the exception will only reach the generator after the values were all iterated over */
        if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
                zval_ptr_dtor(&generator->values);
@@ -394,7 +396,6 @@ static void zend_generator_throw_exception(zend_generator *generator, zval *exce
 
        /* Throw the exception in the context of the generator. Decrementing the opline
         * to pretend the exception happened during the YIELD opcode. */
-       zend_execute_data *original_execute_data = EG(current_execute_data);
        EG(current_execute_data) = generator->execute_data;
        generator->execute_data->opline--;
        if (exception) {