]> granicus.if.org Git - php/commitdiff
Ensure proper set_exception_handler() handling with exit() inside it
authorBob Weinand <bobwei9@hotmail.com>
Fri, 2 Oct 2015 10:37:17 +0000 (12:37 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Fri, 2 Oct 2015 10:37:40 +0000 (12:37 +0200)
sapi/phpdbg/phpdbg_prompt.c

index c16836c8724f64806f8a380de32a20e1c0d1027f..50971b25ecc51f3d00f7125fc9a04c7ca0229c01 100644 (file)
@@ -748,12 +748,20 @@ PHPDBG_COMMAND(run) /* {{{ */
 
                if (restore) {
                        zend_exception_restore();
-                       zend_try_exception_handler();
+                       zend_try {
+                               zend_try_exception_handler();
+                               PHPDBG_G(in_execution) = 1;
+                       } zend_catch {
+                               PHPDBG_G(in_execution) = 0;
+
+                               if (PHPDBG_G(flags) & PHPDBG_IS_STOPPING) {
+                                       zend_bailout();
+                               }
+                       } zend_end_try();
+
                        if (EG(exception)) {
                                phpdbg_handle_exception();
                        }
-
-                       PHPDBG_G(in_execution) = 1;
                }
 
                PHPDBG_G(flags) &= ~PHPDBG_IS_RUNNING;