Skip to content

Commit eafaa65

Browse files
committed
fix infruritating segfault
1 parent 62cf2be commit eafaa65

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

phpdbg_prompt.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -593,20 +593,24 @@ PHPDBG_COMMAND(eval) /* {{{ */
593593

594594
/* disable stepping while eval() in progress */
595595
PHPDBG_G(flags) |= PHPDBG_IN_EVAL;
596-
if (zend_eval_stringl(param->str, param->len,
597-
&retval, "eval()'d code" TSRMLS_CC) == SUCCESS) {
598-
zend_print_zval_r(
599-
&retval, 0 TSRMLS_CC);
600-
phpdbg_writeln(EMPTY);
601-
zval_dtor(&retval);
602-
}
596+
zend_try {
597+
if (zend_eval_stringl(param->str, param->len,
598+
&retval, "eval()'d code" TSRMLS_CC) == SUCCESS) {
599+
zend_print_zval_r(
600+
&retval, 0 TSRMLS_CC);
601+
phpdbg_writeln(EMPTY);
602+
zval_dtor(&retval);
603+
}
604+
} zend_end_try();
603605
PHPDBG_G(flags) &= ~PHPDBG_IN_EVAL;
604606

605607
/* switch stepping back on */
606608
if (stepping &&
607609
!(PHPDBG_G(flags) & PHPDBG_IS_STEPONEVAL)) {
608610
PHPDBG_G(flags) |= PHPDBG_IS_STEPPING;
609611
}
612+
613+
CG(unclean_shutdown) = 0;
610614
} break;
611615

612616
phpdbg_default_switch_case();

0 commit comments

Comments
 (0)