diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2018-01-09 20:20:31 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-01-09 20:20:31 +0100 |
| commit | fd30c59e041eb4ccaabb2099bb3be15a55e2988d (patch) | |
| tree | a90d08e9890391f519abc7b38941695ab1fdf77a /Zend/zend_vm_execute.h | |
| parent | f208187773edd9423e64b5b4dd16b146260c780d (diff) | |
| download | php-git-fd30c59e041eb4ccaabb2099bb3be15a55e2988d.tar.gz | |
Fixed bug #75786
SEND_UNPACK on iterators was duplicating references in-place,
which effectively leaks the original value and causes an off-by-one
refcount on the duplicated value.
Replace this with a deref, as an actual duplication is not even
needed in this case.
Diffstat (limited to 'Zend/zend_vm_execute.h')
| -rw-r--r-- | Zend/zend_vm_execute.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a9735b1c5a..cb20546da9 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1358,11 +1358,8 @@ send_again: ); } - if (Z_ISREF_P(arg)) { - ZVAL_DUP(arg, Z_REFVAL_P(arg)); - } else { - if (Z_REFCOUNTED_P(arg)) Z_ADDREF_P(arg); - } + ZVAL_DEREF(arg); + Z_TRY_ADDREF_P(arg); zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1); top = ZEND_CALL_ARG(EX(call), arg_num); |
