summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_prompt.c
diff options
context:
space:
mode:
authorJohannes Schlüter <johannes@php.net>2014-01-18 13:52:27 +0100
committerJohannes Schlüter <johannes@php.net>2014-01-18 13:52:27 +0100
commit8ff4d61f0864fbca7b2905f14de76fd400d9b3df (patch)
tree0b7513b2b81fe50e76522365d55297a53955fe72 /sapi/phpdbg/phpdbg_prompt.c
parent43a8f4f81439455d22471822bfa5f61708a2dc17 (diff)
parentc205a6f3de9d8923c2be6e16b1edc332981313a3 (diff)
downloadphp-git-8ff4d61f0864fbca7b2905f14de76fd400d9b3df.tar.gz
Merge branch 'phpdbg' into PHP-5.6
Diffstat (limited to 'sapi/phpdbg/phpdbg_prompt.c')
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index bb26556f5c..cb46407957 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -551,7 +551,8 @@ PHPDBG_COMMAND(run) /* {{{ */
zend_op **orig_opline = EG(opline_ptr);
zend_op_array *orig_op_array = EG(active_op_array);
zval **orig_retval_ptr = EG(return_value_ptr_ptr);
-
+ zend_bool restore = 1;
+
if (!PHPDBG_G(ops)) {
if (phpdbg_compile(TSRMLS_C) == FAILURE) {
phpdbg_error("Failed to compile %s, cannot run", PHPDBG_G(exec));
@@ -586,18 +587,19 @@ PHPDBG_COMMAND(run) /* {{{ */
if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
phpdbg_error("Caught exit/error from VM");
- goto out;
+ restore = 0;
}
} zend_end_try();
- if (EG(exception)) {
- phpdbg_handle_exception(TSRMLS_C);
- }
-
- EG(active_op_array) = orig_op_array;
- EG(opline_ptr) = orig_opline;
- EG(return_value_ptr_ptr) = orig_retval_ptr;
+ if (restore) {
+ if (EG(exception)) {
+ phpdbg_handle_exception(TSRMLS_C);
+ }
+ EG(active_op_array) = orig_op_array;
+ EG(opline_ptr) = orig_opline;
+ EG(return_value_ptr_ptr) = orig_retval_ptr;
+ }
} else {
phpdbg_error("Nothing to execute!");
}