mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
Fixed bug #27598 (list() array key assignment causes HUGE memory leak)
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #27598 (list() array key assignment causes HUGE memory leak)
|
||||
--FILE--
|
||||
<?php
|
||||
list($out[0]) = array(1);
|
||||
var_dump($out);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(1)
|
||||
}
|
||||
+1
-6
@@ -3102,7 +3102,6 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
|
||||
zend_llist_element *dimension;
|
||||
zend_op *opline;
|
||||
znode last_container;
|
||||
int opcode_index;
|
||||
int last_op_number;
|
||||
zend_op *last_op;
|
||||
|
||||
@@ -3145,14 +3144,10 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
|
||||
((list_llist_element *) le->data)->value = last_container;
|
||||
zend_llist_destroy(&((list_llist_element *) le->data)->dimensions);
|
||||
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
|
||||
opcode_index = - 1;
|
||||
last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number];
|
||||
if (last_op->opcode == ZEND_FETCH_OBJ_W) {
|
||||
opcode_index = - 2;
|
||||
}
|
||||
zend_do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value TSRMLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last + opcode_index].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
zend_do_free(result TSRMLS_CC);
|
||||
le = le->next;
|
||||
}
|
||||
zend_llist_destroy(&CG(dimension_llist));
|
||||
|
||||
Reference in New Issue
Block a user