Skip to content

Commit 1837eea

Browse files
committed
Merge branch 'PHP-7.1'
* PHP-7.1: Fixed bug #74456 (Segmentation error while running a script in CLI mode)
2 parents 4cd5e68 + d6315c2 commit 1837eea

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

ext/opcache/Optimizer/block_pass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static void zend_optimize_block(zend_basic_block *block, zend_op_array *op_array
186186
COPY_NODE(opline->op1, src->op1);
187187
VAR_SOURCE(op1) = NULL;
188188
MAKE_NOP(src);
189-
} else {
189+
} else if (opline->opcode != ZEND_FETCH_LIST && opline->opcode != ZEND_CASE) {
190190
zval c = ZEND_OP1_LITERAL(src);
191191
zval_copy_ctor(&c);
192192
if (zend_optimizer_update_op1_const(op_array, opline, &c)) {

ext/opcache/tests/bug74456.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #74456 (Segmentation error while running a script in CLI mode)
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=-1
7+
--SKIPIF--
8+
<?php require_once('skipif.inc'); ?>
9+
--FILE--
10+
<?php
11+
12+
13+
function small_numbers() {
14+
return [0,1,2];
15+
}
16+
17+
list ($zero, $one, $two) = small_numbers();
18+
19+
var_dump($zero, $one, $two);
20+
?>
21+
--EXPECT--
22+
int(0)
23+
int(1)
24+
int(2)

0 commit comments

Comments
 (0)