Browse Source

Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash)

PHP-5.1
Dmitry Stogov 20 years ago
parent
commit
a570981151
  1. 3
      NEWS
  2. 2
      Zend/zend_compile.c
  3. 8
      Zend/zend_execute_API.c

3
NEWS

@ -4,6 +4,9 @@ PHP NEWS
- Added an additional field $frame['object'] to the result array of
debug_backtrace() that contains a reference to the respective object when the
frame was called from an object. (Sebastian)
- Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash).
(Dmitry)
24 Nov 2005, PHP 5.1
- Added support for class constants and static members for internal classes.
(Dmitry, Michael Wallner)

2
Zend/zend_compile.c

@ -1730,12 +1730,14 @@ void zend_do_mark_last_catch(znode *first_catch, znode *last_additional_catch TS
} else {
CG(active_op_array)->opcodes[last_additional_catch->u.opline_num].op1.u.EA.type = 1;
}
DEC_BPC(CG(active_op_array));
}
void zend_do_try(znode *try_token TSRMLS_DC)
{
try_token->u.opline_num = zend_add_try_element(get_next_op_number(CG(active_op_array)) TSRMLS_CC);
INC_BPC(CG(active_op_array));
}

8
Zend/zend_execute_API.c

@ -1115,6 +1115,8 @@ void execute_new_code(TSRMLS_D)
INIT_ZVAL(ret_opline->op1.u.constant);
SET_UNUSED(ret_opline->op2);
zend_do_handle_exception(TSRMLS_C);
if (!CG(active_op_array)->start_op) {
CG(active_op_array)->start_op = CG(active_op_array)->opcodes;
}
@ -1153,7 +1155,11 @@ void execute_new_code(TSRMLS_D)
zval_ptr_dtor(&local_retval);
}
CG(active_op_array)->last--; /* get rid of that ZEND_RETURN */
if (EG(exception)) {
zend_exception_error(EG(exception) TSRMLS_CC);
}
CG(active_op_array)->last -= 2; /* get rid of that ZEND_RETURN and ZEND_HANDLE_EXCEPTION */
CG(active_op_array)->start_op = CG(active_op_array)->opcodes+CG(active_op_array)->last;
}

Loading…
Cancel
Save