mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.1'
This commit is contained in:
commit
22e6b5ef22
2 changed files with 20 additions and 0 deletions
16
Zend/tests/bug73960.phpt
Normal file
16
Zend/tests/bug73960.phpt
Normal file
|
@ -0,0 +1,16 @@
|
|||
--TEST--
|
||||
Bug #73960: Leak with instance method calling static method with referenced return
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$value = 'one';
|
||||
$array = array($value);
|
||||
$array = $ref =& $array;
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "one"
|
||||
}
|
|
@ -81,6 +81,10 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
|
|||
return variable_ptr;
|
||||
}
|
||||
if (ZEND_CONST_COND(value_type & (IS_VAR|IS_CV), 1) && variable_ptr == value) {
|
||||
if (value_type == IS_VAR && ref) {
|
||||
ZEND_ASSERT(GC_REFCOUNT(ref) > 1);
|
||||
--GC_REFCOUNT(ref);
|
||||
}
|
||||
return variable_ptr;
|
||||
}
|
||||
garbage = Z_COUNTED_P(variable_ptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue