Skip to content

Commit a63019e

Browse files
Fixed nikic memory leak, but introduced list(&$$a) segfault!
1 parent 5cabb4f commit a63019e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎Zend/zend_compile.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5864,9 +5864,15 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC) /* {{{ */
58645864
last_container = *expr;
58655865
switch (expr->op_type) {
58665866
case IS_VAR:
5867-
case IS_CV:
58685867
opline->opcode = ZEND_FETCH_DIM_R;
58695868
break;
5869+
case IS_CV:
5870+
if (ld->by_ref) {
5871+
opline->opcode = ZEND_FETCH_DIM_W;
5872+
} else {
5873+
opline->opcode = ZEND_FETCH_DIM_R;
5874+
}
5875+
break;
58705876
case IS_TMP_VAR:
58715877
opline->opcode = ZEND_FETCH_DIM_TMP_VAR;
58725878
break;
@@ -5877,7 +5883,11 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC) /* {{{ */
58775883
}
58785884
opline->extended_value |= ZEND_FETCH_ADD_LOCK;
58795885
} else {
5880-
opline->opcode = ZEND_FETCH_DIM_R;
5886+
if (ld->by_ref) {
5887+
opline->opcode = ZEND_FETCH_DIM_W;
5888+
} else {
5889+
opline->opcode = ZEND_FETCH_DIM_R;
5890+
}
58815891
}
58825892
opline->result_type = IS_VAR;
58835893
opline->result.var = get_temporary_variable(CG(active_op_array));

0 commit comments

Comments
 (0)