mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
- Fix the crash Thies was experiencing (returning a function call could cause a crash)
- Fix the leak Thies was experiencing (@fcall() leaked)
This commit is contained in:
parent
f455a484bd
commit
be1bb28355
@ -303,6 +303,8 @@ END_EXTERN_C()
|
||||
if ((pzv)->refcount>1) { \
|
||||
zval_copy_ctor(&(zv)); \
|
||||
(pzv)->refcount--; \
|
||||
} else { \
|
||||
efree(pzv); \
|
||||
} \
|
||||
INIT_PZVAL(&(zv));
|
||||
|
||||
|
@ -2060,8 +2060,13 @@ void do_begin_silence(znode *strudel_token CLS_DC)
|
||||
|
||||
void do_end_silence(znode *strudel_token CLS_DC)
|
||||
{
|
||||
zend_op *last_opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
if ((last_opline->opcode == ZEND_DO_FCALL) || (last_opline->opcode == ZEND_DO_FCALL_BY_NAME)) {
|
||||
last_opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
|
||||
opline->opcode = ZEND_END_SILENCE;
|
||||
opline->op1 = *strudel_token;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
@ -1562,6 +1562,7 @@ do_fcall_common:
|
||||
zval *retval_ptr;
|
||||
zval **retval_ptr_ptr;
|
||||
|
||||
SUSPEND_GARBAGE();
|
||||
if ((EG(active_op_array)->return_reference == ZEND_RETURN_REF) &&
|
||||
(opline->op1.op_type != IS_CONST) &&
|
||||
(opline->op1.op_type != IS_TMP_VAR)) {
|
||||
@ -1595,6 +1596,7 @@ do_fcall_common:
|
||||
(*EG(return_value_ptr_ptr))->is_ref = 0;
|
||||
}
|
||||
}
|
||||
RESUME_GARBAGE();
|
||||
#if SUPPORT_INTERACTIVE
|
||||
op_array->last_executed_op_number = opline-op_array->opcodes;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user