com php-src: Fixed bug #73337 (try/catch not working with two exceptions inside a same operation): NEWS Zend/tests/bug73337.phpt
Zend/zend_execute_API.c

From: Date: Tue, 18 Oct 2016 11:48:01 +0000
Subject: com php-src: Fixed bug #73337 (try/catch not working with two exceptions inside a same operation): NEWS Zend/tests/bug73337.phpt
Zend/zend_execute_API.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95197@lists.php.net to get a copy of this message
Commit: 6558559bcc1cd24e3639e4a215e9d546ee05fc48 Author: Dmitry Stogov <dmitry@zend.com> Tue, 18 Oct 2016 14:48:01 +0300 Parents: 86e603a664afdc3a12ead0eaca5d37fa8a379381 Branches: PHP-5.6 PHP-7.0 PHP-7..1 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6558559bcc1cd24e3639e4a215e9d546ee05fc48 Log: Fixed bug #73337 (try/catch not working with two exceptions inside a same operation) Bugs: https://bugs.php.net/73337 Changed paths: M NEWS A Zend/tests/bug73337.phpt M Zend/zend_execute_API.c Diff: diff --git a/NEWS b/NEWS index 6db7d29..fc2e52c 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2016, PHP 5.6.28 +- Core: + . Fixed bug #73337 (try/catch not working with two exceptions inside a same + operation). (Dmitry) + -GD: . Fixed bug #73213 (Integer overflow in imageline() with antialiasing). (cmb) . Fixed bug #73272 (imagescale() is not affected by, but affects diff --git a/Zend/tests/bug73337.phpt b/Zend/tests/bug73337.phpt new file mode 100644 index 0000000..9eff18e --- /dev/null +++ b/Zend/tests/bug73337.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #73337 (try/catch not working with two exceptions inside a same operation) +--FILE-- +<?php +class d { function __destruct() { throw new Exception; } } +try { new d + new d; } catch (Exception $e) { print "Exception properly caught\n"; } +?> +--EXPECTF-- +Notice: Object of class d could not be converted to int in %sbug73337.php on line 3 + +Notice: Object of class d could not be converted to int in %sbug73337.php on line 3 +Exception properly caught diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 7eeece3..bf754d2 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -826,7 +826,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { *fci->retval_ptr_ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC); } else { + const zend_op *current_opline_before_exception = EG(opline_before_exception); + zend_execute(EG(active_op_array) TSRMLS_CC); + EG(opline_before_exception) = current_opline_before_exception; } if (!fci->symbol_table && EG(active_symbol_table)) {

« previous php.cvs (#95197) next »