[PHP-CVS] com php-src: Fixed bug #63428 (The behavior of execute() changed): Zend/zend_generators.c Zend/zend_vm_execute.h Zend/zend_vm_execute.skl
Commit:7bcb8780e0ed042888f88c78919b7726be9ea931 Author:Xinchen Hui Sun, 4 Nov 2012 12:48:35 +0800 Parents: 3c6b0db05285d2374abc392360d6540c32f6ed66 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7bcb8780e0ed042888f88c78919b7726be9ea931 Log: Fixed bug #63428 (The behavior of execute() changed) Bugs: https://bugs.php.net/63428 Changed paths: M Zend/zend_generators.c M Zend/zend_vm_execute.h M Zend/zend_vm_execute.skl Diff: diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index fba62dd..87f0644 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -461,6 +461,10 @@ static zend_function *zend_generator_get_constructor(zval *object TSRMLS_DC) /* void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ { + if (EG(exception)) { + return; + } + /* The generator is already closed, thus can't resume */ if (!generator->execute_data) { return; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 8c4b594..7a2cfc8 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -419,10 +419,6 @@ ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) - if (EG(exception)) { - return; - } - original_in_execution = EG(in_execution); EG(in_execution) = 1; @@ -459,9 +455,10 @@ ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) { - zend_execute_data *execute_data = zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); - - execute_ex(execute_data TSRMLS_CC); + if (EG(exception)) { + return; + } + execute_ex(zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) TSRMLS_CC); } static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 58e5631..2a6fd71 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -82,10 +82,6 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data TSRMLS_DC) {%INTERNAL_LABELS%} - if (EG(exception)) { - return; - } - original_in_execution = EG(in_execution); EG(in_execution) = 1; @@ -110,9 +106,10 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data TSRMLS_DC) ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) { - zend_execute_data *execute_data = zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); - - {%EXECUTOR_NAME%}_ex(execute_data TSRMLS_CC); + if (EG(exception)) { + return; + } + {%EXECUTOR_NAME%}_ex(zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) TSRMLS_CC); } {%EXTERNAL_EXECUTOR%} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fixed bug #63428 (The behavior of execute() changed): Zend/zend_generators.c Zend/zend_vm_execute.h Zend/zend_vm_execute.skl
Nikic: you may want to review this. thanks On 11/4/12, Xinchen Hui wrote: > Commit:7bcb8780e0ed042888f88c78919b7726be9ea931 > Author:Xinchen Hui Sun, 4 Nov 2012 12:48:35 > +0800 > Parents: 3c6b0db05285d2374abc392360d6540c32f6ed66 > Branches: master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=7bcb8780e0ed042888f88c78919b7726be9ea931 > > Log: > Fixed bug #63428 (The behavior of execute() changed) > > Bugs: > https://bugs.php.net/63428 > > Changed paths: > M Zend/zend_generators.c > M Zend/zend_vm_execute.h > M Zend/zend_vm_execute.skl > > > Diff: > diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c > index fba62dd..87f0644 100644 > --- a/Zend/zend_generators.c > +++ b/Zend/zend_generators.c > @@ -461,6 +461,10 @@ static zend_function > *zend_generator_get_constructor(zval *object TSRMLS_DC) /* > > void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ > { > + if (EG(exception)) { > + return; > + } > + > /* The generator is already closed, thus can't resume */ > if (!generator->execute_data) { > return; > diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h > index 8c4b594..7a2cfc8 100644 > --- a/Zend/zend_vm_execute.h > +++ b/Zend/zend_vm_execute.h > @@ -419,10 +419,6 @@ ZEND_API void execute_ex(zend_execute_data > *execute_data TSRMLS_DC) > > > > - if (EG(exception)) { > - return; > - } > - > original_in_execution = EG(in_execution); > EG(in_execution) = 1; > > @@ -459,9 +455,10 @@ ZEND_API void execute_ex(zend_execute_data > *execute_data TSRMLS_DC) > > ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) > { > - zend_execute_data *execute_data = > zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); > - > - execute_ex(execute_data TSRMLS_CC); > + if (EG(exception)) { > + return; > + } > + execute_ex(zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) > TSRMLS_CC); > } > > static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) > diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl > index 58e5631..2a6fd71 100644 > --- a/Zend/zend_vm_execute.skl > +++ b/Zend/zend_vm_execute.skl > @@ -82,10 +82,6 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data > *execute_data TSRMLS_DC) > > {%INTERNAL_LABELS%} > > - if (EG(exception)) { > - return; > - } > - > original_in_execution = EG(in_execution); > EG(in_execution) = 1; > > @@ -110,9 +106,10 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data > *execute_data TSRMLS_DC) > > ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) > { > - zend_execute_data *execute_data = > zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); > - > - {%EXECUTOR_NAME%}_ex(execute_data TSRMLS_CC); > + if (EG(exception)) { > + return; > + } > + {%EXECUTOR_NAME%}_ex(zend_create_execute_data_from_op_array(op_array, 0 > TSRMLS_CC) TSRMLS_CC); > } > > {%EXTERNAL_EXECUTOR%} > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- 惠新宸laruence Senior PHP Engineer http://www.laruence.com -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fixed bug #63428 (The behavior of execute() changed): Zend/zend_generators.c Zend/zend_vm_execute.h Zend/zend_vm_execute.skl
Looks good to me. Thanks for catching it! Nikita On Sun, Nov 4, 2012 at 5:54 AM, Laruence wrote: > Nikic: >you may want to review this. > > thanks > On 11/4/12, Xinchen Hui wrote: > > Commit:7bcb8780e0ed042888f88c78919b7726be9ea931 > > Author:Xinchen Hui Sun, 4 Nov 2012 > 12:48:35 > > +0800 > > Parents: 3c6b0db05285d2374abc392360d6540c32f6ed66 > > Branches: master > > > > Link: > > > http://git.php.net/?p=php-src.git;a=commitdiff;h=7bcb8780e0ed042888f88c78919b7726be9ea931 > > > > Log: > > Fixed bug #63428 (The behavior of execute() changed) > > > > Bugs: > > https://bugs.php.net/63428 > > > > Changed paths: > > M Zend/zend_generators.c > > M Zend/zend_vm_execute.h > > M Zend/zend_vm_execute.skl > > > > > > Diff: > > diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c > > index fba62dd..87f0644 100644 > > --- a/Zend/zend_generators.c > > +++ b/Zend/zend_generators.c > > @@ -461,6 +461,10 @@ static zend_function > > *zend_generator_get_constructor(zval *object TSRMLS_DC) /* > > > > void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ > */ > > { > > + if (EG(exception)) { > > + return; > > + } > > + > > /* The generator is already closed, thus can't resume */ > > if (!generator->execute_data) { > > return; > > diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h > > index 8c4b594..7a2cfc8 100644 > > --- a/Zend/zend_vm_execute.h > > +++ b/Zend/zend_vm_execute.h > > @@ -419,10 +419,6 @@ ZEND_API void execute_ex(zend_execute_data > > *execute_data TSRMLS_DC) > > > > > > > > - if (EG(exception)) { > > - return; > > - } > > - > > original_in_execution = EG(in_execution); > > EG(in_execution) = 1; > > > > @@ -459,9 +455,10 @@ ZEND_API void execute_ex(zend_execute_data > > *execute_data TSRMLS_DC) > > > > ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) > > { > > - zend_execute_data *execute_data = > > zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); > > - > > - execute_ex(execute_data TSRMLS_CC); > > + if (EG(exception)) { > > + return; > > + } > > + execute_ex(zend_create_execute_data_from_op_array(op_array, 0 > TSRMLS_CC) > > TSRMLS_CC); > > } > > > > static int ZEND_FASTCALL > zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) > > diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl > > index 58e5631..2a6fd71 100644 > > --- a/Zend/zend_vm_execute.skl > > +++ b/Zend/zend_vm_execute.skl > > @@ -82,10 +82,6 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data > > *execute_data TSRMLS_DC) > > > > {%INTERNAL_LABELS%} > > > > - if (EG(exception)) { > > - return; > > - } > > - > > original_in_execution = EG(in_execution); > > EG(in_execution) = 1; > > > > @@ -110,9 +106,10 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data > > *execute_data TSRMLS_DC) > > > > ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) > > { > > - zend_execute_data *execute_data = > > zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); > > - > > - {%EXECUTOR_NAME%}_ex(execute_data TSRMLS_CC); > > + if (EG(exception)) { > > + return; > > + } > > + > {%EXECUTOR_NAME%}_ex(zend_create_execute_data_from_op_array(op_array, 0 > > TSRMLS_CC) TSRMLS_CC); > > } > > > > {%EXTERNAL_EXECUTOR%} > > > > > > -- > > PHP CVS Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > 惠新宸laruence > Senior PHP Engineer > http://www.laruence.com >