From: Kalle Sommer Nielsen Date: Wed, 17 Aug 2016 11:43:50 +0000 (+0200) Subject: Fixed C89 build X-Git-Tag: php-7.1.0beta3~25^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a1fbdda43ed3b36b9331aee1eaace3d961caee9;p=php Fixed C89 build --- diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index f1cc09e938..04fedbe200 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -297,6 +297,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); @@ -305,7 +307,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) {